Warning:move_uploaded_file () [function.move-uploaded-file]:_php Tutorial

Source: Internet
Author: User
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 ...

  • 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.