不断上传php $ _FILES错误= 3(部分上传) [英] keep getting upload php $_FILES error = 3 (partially uploaded)
问题描述
我正在使用Yii框架的dropzone扩展来由注册用户上传一些文件。一切正常,但有些用户尝试上传的某些文件的返回错误= 3,这是在上传的文件仅部分上传的情况下发生的。
I am using dropzone extension for Yii framework to upload some files by registered users. Everything working well but some users for some files that they trying to upload it's return error = 3 which it's happens when the uploaded file was only partially uploaded.
$file_error = $_FILES['Project']['error']['file'];
if ($file_error != 0) {
mail('myemail@gmail.com', 'fileError',json_encode($_FILES['Project']));
}
我从此功能收到很多电子邮件
i'am receiving a lot of emails from this function
接收到JSON
{"name":{"file":"3.jpg"},"type":{"file":""},"tmp_name":{"file":""},"error":{"file":3},"size":{"file":0}}
我如何调试此错误并知道导致此错误发生的情况?
如果用户在上载时刷新页面,则会发生此错误
1-。
2-如果用户取消上传(我的网站中没有取消选项)。
3-如果上传时互联网连接丢失。
how can i debug this error and know the cases that make this error happened ?
This error happened 1- if the user refresh the page while uploading. 2- if the user cancel the upload (there is no cancel option in my site). 3- if the internet connection lost while uploading.
我还在寻找其他情况。
推荐答案
在我的情况下,使用缓慢的Internet连接上传中/大文件时发生了部分上传问题。
in my case, the "partially uploaded" problem happened when uploading medium/large files using a slow internet connection.
最适合我的解决方案是在httpd.conf文件中设置了一些Apache配置:
The solution that works for me was set some Apache configurations in httpd.conf file:
TimeOut 300
KeepAliveTimeout 10
RequestReadTimeout handshake=0 header=20-1200,MinRate=200 body=20,MinRate=200
希望对您有帮助。
这篇关于不断上传php $ _FILES错误= 3(部分上传)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!