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