How to upload files Angular js

7

IwantedtoknownowhowIcanhandleandsendthefiletourlthatIwanttoupload.

    
asked by anonymous 09.09.2015 / 16:18

1 answer

0

On this line:

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

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

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

You can upload individual items by making a foreach in $scope.uploader.queue by running the function upload() or a ng-repeat in the view with a button to do so.

Angular File Upload is marked as [ALMOST NOT MAINTAINED] , so I recommend using ng-file-upload

Any questions with him just let me know.

    
16.11.2018 / 16:40