2

I'm migrating and app I started to develop in angular 1.5 to angular 2.3.

I have a section where the user can upload images and he can see the progress of the uploader. Originally I build it directly with XMLHTTPRequest, but in angular2 the page is being refreshed after the XMLHTTPRequest.

I post a question about that in Angular2 is refreshing the page when doing a post with XMLHttpRequest but as I didn't get any answer after several days, I'm trying to cahnge the approach.

Is it possible to submit a file using a post and get the percentage of the progress? I need to send it to a backend with an authorization header with a JWT token, so I'm not sure if the ng-upload package is useful for me.

[[All the code is in the shared link]] Angular2 is refreshing the page when doing a post with XMLHttpRequest

4
  • It's possible to upload progress and you can also add auth headers with this module - valor-software.com/ng2-file-upload Commented Feb 27, 2017 at 0:01
  • @Dylan thanks for that, I didn't know that I can added the header there... Anyway, The page is refreshed after the upload for that method too... I added the backend code in the other question just in case it can be generated by the backend... Commented Feb 27, 2017 at 2:49
  • I think I can check you answer as the correct one as you anser the scope of my question.. But if you can give me a hand with the issue I'm still having, I'll appreciate. Commented Feb 27, 2017 at 2:50
  • Possible duplicate of How to use angular2 http API for tracking upload/download progress Commented Jul 21, 2017 at 12:27

0

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.