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

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

WBOY
发布: 2016-07-09 09:10:24
原创
1771 人浏览过

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

来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门推荐
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板