I'm letting the user select files and then trying to programmatically uploading them after they click the upload button using the jquery fileupload script
The HTML looks like this:
<input name="my_image[]" id="my_file" type="file" multiple="multiple">
The jquery call looks like this:
$('#start-upload').click(function(e) {
var filesList = $('#my_file')[0].files;
//var filesList = $('#my_file').prop("files");
var url = 'photos/index.php';
$('#my_file').fileupload('send', {
files: filesList,
url: url,
dataType: 'json',
start: function(e, data) {
console.log("Upload started");
},
done: function (e, data) {
console.log("Upload complete");
}
});
});
This is the error I get:
Uncaught Error: cannot call methods on fileupload prior to initialization; attempted to call method 'send'
Any idea what I'm doing?
sendin this case). The link gilly3 posted shows an example of how to initialize it correctlysend, where I assume that passing all required options in thesendcall would be enough.