php文件上传中出现如下错误
Warning: move_uploaded_file(upload/pal4bz111.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory inE:\Eclipse\Workspace\PHPTest\file_upload\t2.php on line 24
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'D:\xampplite\tmp\php7FC5.tmp' to 'upload/pal4bz111.jpg' inE:\Eclipse\Workspace\PHPTest\file_upload\t2.php on line 24
Stored in: upload/pal4bz111.jpg
解决办法
将
move_uploaded_file($_FILES["file"]["tmp_name"],"upload/" . $_FILES["file"]["name"])
改为
move_uploaded_file($_FILES["file"]["tmp_name"],"d:/" . $_FILES["file"]["name"])
注:windows环境