Guest User

Untitled

a guest
Oct 19th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. function upload(file, attachableId, className, appName){
  2. var fd = new FormData();
  3. fd.append("file", file);
  4. return $http({
  5. method: 'POST',
  6. data: fd,
  7. url: URL+"?attachableId="+attachableId+"&className="+className+"&appName="+appName,
  8. headers: {'Content-Type': undefined},
  9. uploadEventHandlers: {
  10. progress : function(e){
  11.  
  12. // I want to access the value of e.loaded in my directive each time it changes
  13. // so that I can update my progress bar
  14.  
  15. console.log(e.loaded + " uploaded of " + e.total);
  16. }
  17. }
  18. })
  19. }
Add Comment
Please, Sign In to add comment