uploadprogress_get_info 和大文件
看来 PECL 包“uploadprogress”适用于小于 10MB 的文件,
但是任何大于 10MB 的文件,它都会严重失败。
我已经更改了 php.ini 以支持更大的上传,但它只是不返回任何内容!
对此有什么帮助吗?
It seems that the PECL package "uploadprogress" works on files less then 10MB,
But Anything greater than 10MB, it fails miserably.
I've changed my php.ini to support larger upload, but it just doesn't return anything!
Any Help on this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 php.ini 中将 upload_max_filesize 和 post_max_size 更改为更大的值后。然后不要忘记重新启动apache。
After changing upload_max_filesize and post_max_size to some larger value in php.ini. Then don't forget to restart apache.
uploadProgress 需要注意的一些事项。
如果您已正确安装 UploadProgress,如果您仍然遇到问题并且已安装 Modsecurity,请继续阅读。
如果您使用 modsecurity,则需要编辑
/etc/httpd/conf.d/modsecurity.conf 使用您最喜欢的编辑
器
Modsecurity 将由于缓冲问题而停止 uploadprogress 工作。简而言之,您可以解决此问题,但会给您的服务器带来一些安全成本:
首先(这样做会带来安全风险)编辑该行:
将指令更改为
(在 apache/服务器重新启动您的上传进度应该可以工作!)
不要忘记,如果您已经安装了 ModSecurity,您还需要编辑大文件上传的指令,因为 modsecurity 负责最大上传文件大小,为此请编辑此指令
:例如,您需要增加位数以允许您允许用户上传的最大字节数。
10M 看起来像这样:
不要忘记重新启动服务器
(对于分用户,您可以重新启动 service httpd)
这两个问题让我困扰了好几天!
希望有帮助..
A few things to note with uploadProgress.
Providing you have installed UploadProgress correctly, if you are still having issues and you have installed Modsecurity, read on.
If you are using modsecurity you will need to edit
/etc/httpd/conf.d/modsecurity.conf using your favourite editor
Eg.
Modsecurity will stop uploadprogress working due to buffering issues.. in short you can fix this but at some security cost to your server:
First (and by doing so opening a security risk) edit the line:
change the directive to
(after an apache/ server restart your upload progress should work!)
Don't forget if you have installed ModSecurity you will also need to edit a directive for large file uploads, as modsecurity takes charge of the max upload file size, to do so edit this directive:
as an example you will need to up the number in bits to allow the maximum bytes you intend to allow your users to upload.
10M would look like this:
Don't forget to restart your server
(for cent users you can do service httpd restart)
Both of these issues threw me for days!
Hope it helps..