keep getting upload php $_FILES error = 3 (partially uploaded)(不断上传 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(部分上传)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:不断上传 php $_FILES 错误 = 3(部分上传)


基础教程推荐
- 找不到类“AppHttpControllersDB",我也无法使用新模型 2022-01-01
- 使用 PDO 转义列名 2021-01-01
- HTTP 与 FTP 上传 2021-01-01
- 如何在 XAMPP 上启用 mysqli? 2021-01-01
- Doctrine 2 - 在多对多关系中记录更改 2022-01-01
- 在 CakePHP 2.0 中使用 Html Helper 时未定义的变量 2021-01-01
- PHP 守护进程/worker 环境 2022-01-01
- 在 yii2 中迁移时出现异常“找不到驱动程序" 2022-01-01
- 如何在 Symfony 和 Doctrine 中实现多对多和一对多? 2022-01-01
- phpmyadmin 错误“#1062 - 密钥 1 的重复条目‘1’" 2022-01-01