12

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 and 1GB memory, 64bit

File uploading is working in Google Chromeand 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 header response

Arslan Butt
  • 775
  • 1
  • 8
  • 20
  • 2
    Your server will be the issue then, it tries to store the file in memory (you've only got 1gig), my suggestion would be to use something like wamp or xampp on a machine with more memory and try that – Can O' Spam Dec 02 '15 at 09:59
  • check web server error logs. There will be the exact error. It can be a time out or size limit. – Harikrishnan Dec 02 '15 at 10:01
  • Check your yii configuration for session timeout value, this should also be 7200. Also check where you login the user, in this call you can also [set a timeout](http://www.yiiframework.com/doc/api/1.1/CWebUser#login-detail) – chris--- Dec 02 '15 at 10:01
  • Oky @Harikrishnan let me check server logs – Arslan Butt Dec 02 '15 at 10:18
  • @Harikrishnan session.gc_maxlifetime Local Value = 7200, master Value = 1440 session.cookie_lifetime Local Value = 7200, master Value = 0 – Arslan Butt Dec 03 '15 at 04:37
  • Did you ever find a resolution to this issue without using chunked uploads. I am facing the exact same issue with firefox. – Indivision Dev Sep 29 '16 at 09:54

1 Answers1

8

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.

Harikrishnan
  • 9,688
  • 11
  • 84
  • 127