nervgh / angular-file-upload

[ALMOST NOT MAINTAINED] Angular File Upload is a module for the AngularJS framework
MIT License
3.44k stars 1.13k forks source link

Calling a upload function on button click instead of image upload. #870

Open phanikumar252 opened 4 years ago

phanikumar252 commented 4 years ago

Hi, how to call uploader function from angularJs controller on button click instead of at the time of uploading image. Please help me on this. Thanks

ygj6 commented 3 years ago

You can upload files by calling uploader.uploadItem(item). You can obtain item by calling uploader.getNotUploadedItems(). For example:

    uploader.onAfterAddingFile = function (item) {
        console.log(uploader.getNotUploadedItems ());
        uploader.uploadItem(item);
    }

See Module-API#methods