2

I handled file upload in Angular 5 using listening to progress events method. also displaying progress percentage bar.

https://angular.io/guide/http#listening-to-progress-events.

It works good when uploading small size files (below 20 mb). If I try to upload large size file (100 MB or 1GB), the progress percentage bar running upto 40% or sometimes 70% then suddenly it stopped running. It shows error net:ERR_CONNECTION_RESET. At this moment, If I leave the page idle, the upload progress gets finished. But in UI, it is stuck at 40% or 70% like that.. I could not find the exact problem what is reason for this issue. Please suggest solution if you guys had faced this issue.

4
  • Where exactly are you uploading this file? Commented Sep 22, 2018 at 6:05
  • Upload progress handled in frontend side, once the progress 100% complete, It will hit the backend API and get the (status:200) response. Commented Sep 22, 2018 at 6:21
  • Check on your back-end max file size and max request size Commented Sep 22, 2018 at 6:42
  • 1
    This can happen if the server is signaling a reset on the TCP level (because of an error. Possibly exceeding the max limit) and the client (in this case browser) is flushing its own incoming TCP buffer and as a result missing the returned response. Please read Why the lingering close functionality is necessary with HTTP Commented Apr 5, 2019 at 14:26

1 Answer 1

3

In any case, the best practice for large file uploading is to split a file by blob-parts.

let blob = file.slice(start, next_slice);

where start - would be a start index and next_slice your needed limit for splicing which should be included inside a loop to proceed progress.

on server-side also, first, you need to store chunks and combine them into one file after completing.

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

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.