79134246

Date: 2024-10-28 16:19:06
Score: 0.5
Natty:
Report link

Assalam Aleykum.

There are not many behavours on this case. There are some:

If you specify an approximate size in the response headers, the download will still start and most browsers or download managers will display progress based on this value.

Too large: The progress bar may show 100% until the download is complete. This may confuse the user, but the download will still complete correctly. Too small: The progress may exceed 100%, which may also be confusing, but the download will not be affected.

Solutions, which i ecomend:

Use Chunked Transfer Encoding. This is a more reliable way to transfer large files in chunks. Data is transmitted in fixed blocks, making it more convenient and efficient for large volumes. However, one drawback is that the completion percentage and total file size may not be accurately displayed.

Use AJAX request to get the status. Implement a separate API endpoint that will return the current status of archiving and downloading, for example, how many files have already been added to the archive. On the client you can make a progress bar with periodic requests to this API.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Фахриддин Бердиев