不断上传 php $_FILES 错误 = 3(部分上传) [英] keep getting upload php $_FILES error = 3 (partially uploaded)

查看:23
本文介绍了不断上传 php $_FILES 错误 = 3(部分上传)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 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.

我还在寻找其他案例.

推荐答案

就我而言,使用慢速互联网连接上传中/大文件时出现部分上传"问题.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆