Guest User

Untitled

a guest
Jun 21st, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. let conf= {
  2. onUploadProgress: function (progressEvent) {
  3. let percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total);
  4. },
  5. headers: { 'content-type': 'application/x-www-form-urlencoded' }
  6. };
  7.  
  8. let a = new FormData();
  9. a.append('file', file[0]);
  10.  
  11.  
  12. axios
  13. .put(url, a, conf)
  14. .then(function (res) {
  15. console.log(res.data);
  16. })
  17. .catch(function (err) {
  18. console.log(err);
  19. });
Add Comment
Please, Sign In to add comment