$http upload file progress in AngularJS

后端 未结 6 1688
南笙
南笙 2020-12-04 22:19

How can I get a \'progress\' event from my AngularJS $http POST request that is uploading an image? Is it possible to do this client-side, or do I need the server to report

6条回答
  •  眼角桃花
    2020-12-04 22:38

    I don't think $http.post() can be used for this.

    As for client-side, it should work with an HTML5 browser, but you'll probably have to create your own XMLHttpRequest object and onprogress listener. See AngularJS: tracking status of each file being uploaded simultaneously for ideas.

提交回复
热议问题