uploadprogress_get_info 和大文件

发布于 2024-09-14 07:03:35 字数 143 浏览 5 评论 0原文

看来 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

难如初 2024-09-21 07:03:35

在 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.

时光无声 2024-09-21 07:03:35

uploadProgress 需要注意的一些事项。

如果您已正确安装 UploadProgress,如果您仍然遇到问题并且已安装 Modsecurity,请继续阅读。

如果您使用 modsecurity,则需要编辑
/etc/httpd/conf.d/modsecurity.conf 使用您最喜欢的编辑

vi /etc/httpd/conf.d/modsecurity.conf

Modsecurity 将由于缓冲问题而停止 uploadprogress 工作。简而言之,您可以解决此问题,但会给您的服务器带来一些安全成本:

首先(这样做会带来安全风险)编辑该行:

SecRequestBodyAccess On

将指令更改为

SecRequestBodyAccess Off

(在 apache/服务器重新启动您的上传进度应该可以工作!)

不要忘记,如果您已经安装了 ModSecurity,您还需要编辑大文件上传的指令,因为 modsecurity 负责最大上传文件大小,为此请编辑此指令

SecRequestBodyLimit 3107200

:例如,您需要增加位数以允许您允许用户上传的最大字节数。

10M 看起来像这样:

SecRequestBodyLimit 10485760

不要忘记重新启动服务器

(对于分用户,您可以重新启动 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.

vi /etc/httpd/conf.d/modsecurity.conf

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:

SecRequestBodyAccess On

change the directive to

SecRequestBodyAccess Off

(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:

SecRequestBodyLimit 3107200

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:

SecRequestBodyLimit 10485760

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..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文