首页 >php教程 >php手册 >php文件上传 [function.move-uploaded-file]: failed to open stream 错误解决办法

php文件上传 [function.move-uploaded-file]: failed to open stream 错误解决办法

WBOY
WBOY原创
2016-07-09 09:10:241773浏览

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环境

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn