Angular file upload progress percentage

komron picture komron · Oct 31, 2017 · Viewed 38.4k times · Source

In my application that i am developing in Angular 4, user can upload multipart files into server. Files are large. I need to show the current progress of file upload process with it's percentage to user, how can i do it?

Thanks in advance!

Answer

Shantam Mittal picture Shantam Mittal · Apr 24, 2019
uploadDocument(file) {

    return this.httpClient.post(environment.uploadDocument, file, { reportProgress: true, observe: 'events' })
}