I have at the moment af button
and a file input
field to upload files.
Button
<button type="button" class="btn btn-success pull-right" ng-click="uploader.uploadAll()">Upload</button>
Input field
<input id="myUploader" type="file" uploader="uploader">
At the moment I first have to choose a file, with the input field
, and then my button
enables itself, which allow me to click on it and upload the file.
What I really want is to be able to directly click the button, which allows my to choose a file, and then automatically upload the file after it is chosen.
I've accomplished the first part by changing the ng-click="uploader.uploadAll()"
with an onclick="$('#myUploader').trigger('click');"
My problem now is that I don't know how to trigger the uploader.uploadAll()
function
after the file is chosen.
Can anybody help me?