The code is as follows:
upload.php
if ($_files["file" ["error"] > 0)
{
echo "Return Code:". $_files["File" ["Error"]. "
";
}
Else
{
echo "Upload:". $_files["File" ["Name"]. "
";
echo "Type:". $_files["File" ["type"]. "
";
echo "Size:". ($_files["File" ["Size"]/1024). The Kb
";
echo "Temp file:". $_files["File" ["Tmp_name"]. "
";
if (file_exists ("upload/". $_files["File" ["Name"]))
{
echo $_files["File" ["Name"]. "already exists.";
}
Else
{
Move_uploaded_file ($_files["file"] ["Tmp_name"],
"Upload/". $_files["File" ["name"]);
echo "Stored in:". " Upload/". $_files["File" ["Name"];
}
}
?>
Operation Result:
Upload:jdk-6u34-windows-x64.exe
Type:application/octet-stream
size:61154.484375 Kb
Temp file:f:\xampp\tmp\phpcb11.tmp
Warning:move_uploaded_file (Upload/jdk-6u34-windows-x64.exe): Failed to open stream:no such file or directory in F:\XAMPP \htdocs\test\qwe.php on line 26
Warning:move_uploaded_file (): Unable to move ' F:\xampp\tmp\phpCB11.tmp ' to ' Upload/jdk-6u34-windows-x64.exe ' in f:\ xampp\htdocs\test\qwe.php on line 26
Stored In:upload/jdk-6u34-windows-x64.exe
Tangled for a long time, the platform environment is installed under the Windows Platform XAMPP integrated environment
and want to know why ....
Reply to discussion (solution)
Directory upload does not exist
Possible causes:
1. The path is not correct.
2. folder does not have permissions.
Add DirName (__file__) to see.
if (File_exists (DirName (__file__). /upload/". $_files["File" ["Name"]))
Failed to open stream:no such file or directory
Dude, have you solved this? I built the lamp environment under Ubuntu and there was the same problem. I can't find the uploaded file.