In a php file upload system, the use of move_uploaded_file file upload, prompted the following two warning, can not upload files successfully
Warning: Move_uploaded_file (upload/songshu_rgb.gif) [Function.move-uploaded-file]: failed to open Stream:no Such file or directory in D:\www\2737\upload_file.phpon line
Warning: Move_uploaded_file () [Function.move-uploaded-file]: Unable to move ' C:\WINDOWS\Temp\php80.tmp ' to ' Upload/songshu_rgb.gif ' in D:\www\2737\upload_file.php
Stored In:upload/songshu_rgb.gif
Previously considered to be insufficient directory permissions, after looking for information, in fact, is the reason why the file is not found, how to solve it? Find data find, should use absolute path instead of relative path, the original code is as follows
Move_uploaded_file ($_files["file"] ["Tmp_name"],
"upload/" . $_files["File" ["name"]);
echo "Stored in:". " Upload/". $_files["File" ["Name"];
After modification:
Move_uploaded_file ($_files["file"] ["Tmp_name"],
"d:/www/2737/upload/" . $_files["File" ["name"]);
echo "Stored in:". " Upload/". $_files["File" ["Name"];
Note the highlight section.
There is a way to modify permissions, change the permissions to 777 can be, more trouble, we can find the following article to see.
Http://www.360doc.com/content/12/1023/17/7851074_243314218.shtml
Call move_uploaded_file function hint in PHP failed to open stream and unable to move