How to upload Angular js files

Asked

Viewed 4,961 times

6

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

wanted to know now how to grab and send the file to url I want to upload.

  • 1

    ng-file-upload: https://github.com/danialfarid/ng-file-upload

  • If you understand English, the following link is useful to you: http://stackoverflow.com/questions/18571001/file-upload-using-angularjs I liked the best answer.

1 answer

0

Along those lines:

var uploader = $scope.uploader = new FileUploader({
      url: 'upload.php'
    });

You set the url to which you want to send the item(s) to).

After the form receives the items you need to perform the function: $scope.uploader.uploadAll() or puts a button for the user to do this with the attribute: ng-click="uploader.uploadAll()"

It is possible to upload items individually by making a foreach in the $scope.uploader.queue running the function upload() or a ng-repeat in the view with a button for this.


The Angular File Upload is marked as [ALMOST NOT MAINTAINED], for this reason I recommend using the ng-file-upload

Any questions with him just let me know.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.