File uploads, pediatrics questions,

Source: Internet
Author: User
Micro-0.6 file upload, attachment directory to 777, but upload still have a problem:
Tip: Saving upload file failed
if (!file_move ($file [' Tmp_name '], attachment_root. '/' . $result [' path ']) {
Return error (-1, ' Save upload file failed ');


Is it a path problem?


Reply to discussion (solution)

Echo Attachment_root. '/' . $result [' Path '];
See what it is?

In addition, is your server a cloud space?

It's cloud space, I'll try.

Echo Attachment_root. '/' . $result [' Path '];

if (!file_move ($file [' Tmp_name '], attachment_root. '/' . $result [' path ']) {
Return error (-1, ' Save upload file failed ');
}

Echo Attachment_root. '/' . $result [' Path '];
The goal is to see if your target file name is correct.

Is it cloud space? Confirm not a cloud host?
If it is a cloud space, it is not supported PHP file Operation function, please confirm that you have purchased the file system services they provide

if (!file_move ($file [' Tmp_name '], attachment_root. '/' . $result [' path ']) {
Return error (Echo Attachment_root. '/' . $result [' Path '];

There is no output, it is always turning

Change in php.ini?

Echo Attachment_root. '/' . $result [' Path '];
No output?
Block other code First, just perform this look.

If there is no output, there is already a problem with the previous code.

Attachment_root. '/' . $result [' Path '])
Determine the directory permission is 777

is a permission issue, 777 is the reason for not inheriting

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.