File pick with Angular JS

后端 未结 8 761
时光取名叫无心
时光取名叫无心 2020-12-08 07:50

I would like to pick up a file with AngularJS:

HTML:

8条回答
  •  隐瞒了意图╮
    2020-12-08 08:10

    Teemu solution will not work for IE9.

    I have put together a simple angular directive with Flash polyfill for browsers not supporting HTML5 FormData, you can also listen to upload progress event.

    https://github.com/danialfarid/ng-file-upload Demo: http://angular-file-upload.appspot.com/

    
    
    
    

    controller:

    Upload.upload({
        url: 'my/upload/url',
        data: additionalData,
        file: files
      }).then(success, error, progress); 
    

提交回复
热议问题