Blogger Information
Blog 142
fans 5
comment 0
visits 128619
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
PHP上传 找不到临时文件夹的解决方法
php开发大牛
Original
706 people have browsed it

最近遇到这样的麻烦,找不到临时文件夹返回的错误代码为6

错误原因:

一、配置文件没有设置临时文件夹

二、临时文件夹没有或者上级文件夹没有相应的权限

处理方式:

找到PHP配置文件PHP.ini,找到以下代码

;upload_tmp_dir =

改为:

upload_tmp_dir = "C:/Windows/Temp"  //后面的文件夹路径根据您的系统来设置

如果是权限不够的情况,可以根据不通的操作系统系统分别给其文件加上相应的权限

其他知识:

$_FILES['file']['error']

其值为 0,没有错误发生,文件上传成功。

其值为 1,上传的文件超过了 PHP.ini 中 upload_max_filesize 选项限制的值。

其值为 2,上传文件的大小超过了 HTML表单中 MAX_FILE_SIZE 选项指定的值。

其值为 3,文件只有部分被上传。

其值为 4,没有文件被上传。

其值为 6,找不到临时文件夹。PHP4.3.10 和 PHP5.0.3 引进。

其值为 7,文件写入失败。PHP5.1.0 引进。

看报错的话,应该是临时文件夹没有写权限或者不存在

总结


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!