Warning:move_uploaded_file () [Function.move-uploaded-file]: Unable to move
Today file upload appears warning:move_uploaded_file () [Function.move-uploaded-file]: Unable to move
if (!empty ($_files[fileup][name])) {
$fileinfo =$_files[fileup];
$type =strstr ($fileinfo [' name '], ".");
if ($type! = ". jpg") {
echo "The file you uploaded is not in the correct format!" ";
}else{
if ($fileinfo [' Size ']<209715 && $fileinfo [' size ']>0) {
$path = "10/". $_files["Fileup" ["Name"];
Move_uploaded_file ($fileinfo [' Tmp_name '], $path);
if (Is_dir ("10/")) {
$dir =scandir ("10/");
foreach ($dir as $value) {
echo $value. "
";
}
}else{
echo "Directory path Error! ";
}
}else{
echo ' file size does not meet the requirements! ';
}
}
}
?>
Operation Result:
Warning:move_uploaded_file (10/02.jpg) [Function.move-uploaded-file]: failed to open stream:no such file or directory in E:apps Tutorial erv-win32-2.5.10appservwww10index_7.php on line 26
Warning:move_uploaded_file () [Function.move-uploaded-file]: Unable to move ' c:windowstempphp1a.tmp ' to ' 10/02.jpg ' in E : appserv-win32-2.5.10appservwww10index_7.php on line 26
Directory path Error!
Solution, change the relative path to absolute
$_server[document_root]. '/10/'. $_files[' fileup ' [' name '];
Solutions
Will
Move_uploaded_file ($_files["File" ["Tmp_name"], "upload/". $_files["File" ["Name"])
Switch
Move_uploaded_file ($_files["File" ["Tmp_name"], "d:/". $_files["File" ["Name"])
Method Two
Warning:move_uploaded_file () [Function.move-uploaded-file]: Unable to move
A similar error occurred when uploading, because the directory permission is a writable issue.
General settings 777 can be resolved. 、
Modify Permissions Command:
chmod 777 filename
chmod 777 DirName
sudo chmod 777 Filename/dirname
Chown wangr:admin dirname-r
Note:-R batch Execution
http://www.bkjia.com/PHPjc/632284.html www.bkjia.com true http://www.bkjia.com/PHPjc/632284.html techarticle warning:move_uploaded_file () [Function.move-uploaded-file]: Unable to move today file upload appears warning:move_uploaded_file () [Function.move-uploaded-file]: Unable to move form ...