问题
I am trying to upload a large file over 1GB
to 2GB
using jQuery File Upload - blueimp
(Ajax based) php / yii Framework 1.15
i have set these values to upload larger file
memory_limit = 2048M
upload_max_filesize = 2048M
post_max_size = 2048M
Session time set
ini_set('session.gc_maxlifetime', 7200);
I test lesser than 1GB
file that is uploading successfully
when I am trying to upload larger than 1GB
file it shows Forbidden error after 50mins uploading time...
Server Specifications
- it's a virtual machine, and due to it's not production yet so we only
using
1CPU
and1GB 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
回答1:
When you upload files having size more than 100 MB, better go for chunked file uploads. jQuery-File-Upload supports that.
It splits files into smaller fragments with predefined chunk size and upload them one by one. Another advantage is that you can resume file uploads. No need to upload entire file again, if the upload is interrupted. Also it can overcome your upload_max_filesize
and post_max_size
issue.
来源:https://stackoverflow.com/questions/34039651/upload-a-large-file-over-1gb-to-2gb-using-jquery-file-upload-blueimp-ajax-bas