3

I'm uploading large files using JQuery File Upload to an NGINX server with the PHP backend. The upload works for files up to and around 2GB but larger files around 6 or 8GB reach the end but show the following error message

The uploaded file was only partially uploaded

enter image description here

I've updated my nginx.conf:

http {
        sendfile           on;
        keepalive_timeout  65;

        server {
 ...
                client_max_body_size 20000000M;

 ...
        }
}

And my php.ini for php-fpm:

memory_limit = 512000000M

upload_max_filesize = 0 

post_max_size = 200000M

max_execution_time = 4320000

max_input_time = 4320000

The file upload take under an hour to complete in all cases.

Here is Chrome's Inspect Element output:

enter image description here

enter image description here

enter image description here

10
  • Hן Ben I suspect your php.ini settings - can you describe which server are you using CMS maybe? try adding a ini get to all the critical settings to be sure they are followed by your server just before the upload starts. Commented Mar 17, 2014 at 0:03
  • Also try using ini_set() before the file upload and uncrease limitations for session.gc_maxlifetime, session.cookie_lifetime, session.cache_expire. Last thing try setting a limitation to upload_max_filesize that is not unlimited. Commented Mar 17, 2014 at 0:09
  • I'm using NGINX server with php-fpm. @ShlomiHassid Commented Mar 17, 2014 at 10:14
  • I've added in ini_set('session.gc_maxlifetime', 9999999999999999); ini_set('session.cookie_lifetime', 9999999999999999); ini_set('session.cache_expire', 9999999999999999); and set upload_max_filesize to 500000000M but see the same error. Commented Mar 17, 2014 at 13:40
  • Really curious, how do you accurately test a 2.0 GB file upload in development without waiting hours?? Commented Mar 20, 2014 at 1:19

3 Answers 3

0

This is nothing to do with php.ini or jquery uploader.

Just monitor your system resources closely to get close to the solution:

  1. uploaded files are saved in temp folders (monitor this closely).
  2. Your system RAM resource.
  3. Your system storage capacity.

Beside these possibilities, check if your host/environment truncate long POST requests (by time or amount of data travelled)

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks prady the server resources are fine. I might try changing the tmp folder but it's strange that it works for files as large as 1.6GB
Do timeout and keepalive_timeout setting effect large uploads?
Yes, they do try making them -1 ;)
0

There was issue in PHP 5.3 while uploading file with size more than 2gb. It was solved in PHP 5.4 if i am not mistaken.

1 Comment

I'm running PHP 5.4.25 on the server.
0

Have you tried to upload a file using a plain form? eg:

<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Submit">
</form>

Also I would try to setup a nginx server locally to cut down upload time. If it still fails you can rule out timeouts and even filesystem/disk issues.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.