基于以下问答: ASP.NET Core 2.0 and Angular 4.3 File Upload with progress
与上述问题相关的:How ASP.NET reports UploadProgress?
XMLHttpRequest具有一个Progress事件,我们可以使用Angular来查看上传进度,如下所示:
this.http.request(req).subscribe(event => {
if (event.type === HttpEventType.UploadProgress)
this.uploadProgress = Math.round(100 * event.loaded / event.total);
else if (event instanceof HttpResponse)
console.log('Files uploaded!');
});
问题: 这是否意味着此 event (HttpEventType)对象仅保存上传信息,服务器不会承担多少工作?
示例:
在这种情况下,Angular代码仅显示10秒的进度?