Home > Software engineering >  reportProgress Angular doesn't work with Web API AspNet?
reportProgress Angular doesn't work with Web API AspNet?

Time:09-16

I'm write a upload component any files, I am use angular 12 and ASP.NET Web API but report progress doesn't work.

I would want do something like this : enter image description here

CodePudding user response:

Instead of DownloadProgress you probably want UploadProgress

    case HttpEventType.DownloadProgress: // this should be UploadProgress
          const kbLoaded = Math.round(event.loaded / 1024);
          console.log(`Download in progress! ${ kbLoaded }Kb loaded`);
          break;
  • Related