0

I'm uploading a 5 GB file and the upload progress bar resets at 40%.

When it gets to 40% it starts counting again from 0%.

Eventually the file does upload completely but this is not good UX.

I was wondering if any knows how I can make the progress bar reach 100% like it should.

EDIT:

Here are some configuration settings requested in the comments:

post_max_size = 6G
upload_max_filesize = 6G
default_socket_timeout = 60
max_execution_time = 7200
max_input_time = 7200

This doesn't happen for smaller sized files.

When uploading the 5G file, the file upload does end. It doesn't get to 40% again after it resets to 0. It seems to get stuck at 19%.

All this time the file is being correctly uploaded to the temporary directory like it should. Like when the bar reaches 40% the file will continue to upload the temp file until it reaches the full 5G.

Upload Progress Image

5
  • And the file upload limit, timeout limit and post max size in your PHP config on your server is what exactly? Does the same happen with smaller files? And just for clarification: The file does upload in the end? So, like two times 40% and another 20% and it's done? Please update your question and add the missing info. Many thanks and good luck 🙂
    – leymannx
    Commented Jan 18, 2021 at 17:50
  • Thanks for the suggestions @leymannx. I did update the post with the additional information you requested.
    – pmagunia
    Commented Jan 18, 2021 at 18:02
  • 2
    40% of 5gb is 2gb, which might be a clue, as 2gb appears all over the place as a limit for uploads (Apache custom LimitRequestBody, some browsers I think, probably other things). If you try to upload a different sized large file, does the percentage it "crashes" at go down? e.g. 20% for a 10gb file, 50% for 4gb, etc?
    – Clive
    Commented Jan 18, 2021 at 20:03
  • @Clive Thank you - I will upload a different file size and post the results when I am at my computer again.
    – pmagunia
    Commented Jan 19, 2021 at 17:34
  • I found this related thread on the Pecl site. It seems the 2GB limit is an open bug for the upload progress bar: bugs.php.net/bug.php?id=59918
    – pmagunia
    Commented Jan 20, 2021 at 20:55

1 Answer 1

1

I was able to fix the Upload Progress so that it didn't stop at 40% (2 GB).

This is a temporary fix:

I uncommented the ondrej repo in the sources list (/etc/apt). This gave me access to uploadprogress 1.1.3-3 which has a couple of patches that the PECL repo doesn't have.

Then I got the source code:

apt source php7.3-uploadprogress

cd php-uploadprogress-1.1.3

And changed:

int read_bytes;

to:

unsigned long int read_bytes;

and recompiled from the source:

phpize; ./configure; make; make test; sudo make install; sudo service apache2 reload

It seems like the references to int were all changed except the reference to read_bytes. The maximum value of an int is 2GB.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.