我正在尝试上传一个大文件1GB
to 2GB
using jQuery File Upload - blueimp
(基于阿贾克斯)php / yii Framework 1.15
我已设置这些值来上传更大的文件
memory_limit = 2048M
upload_max_filesize = 2048M
post_max_size = 2048M
会话时间设定
ini_set('session.gc_maxlifetime', 7200);
我测试小于1GB
上传成功的文件
当我尝试上传大于1GB
文件在 50 分钟上传时间后显示禁止错误...
服务器规格
- 它是一个虚拟机,由于它还没有生产,所以我们只
使用
1CPU
and 1GB memory
, 64bit
File uploading is working in Google Chrome
and Microsoft Edge
(I have tested with 1.15 and 1.88 GB file) when I am uploading file in Mozilla Firefox
less than 300MB it is uploading successfully but when I am trying yo upload greater than 300MB file after some time Ajax call is fails and give 500 Internal Server Error
header response is in below image
当您上传大小超过 100 MB 的文件时,最好选择分块文件上传 https://github.com/blueimp/jQuery-File-Upload/wiki/Chunked-file-uploads。 jQuery-File-Upload 支持这一点。
它将文件分割成具有预定义块大小的较小片段,然后将它们一一上传。另一个优点是您可以恢复文件上传。如果上传中断,无需再次上传整个文件。它还可以克服你的upload_max_filesize
and post_max_size
issue.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)