I'm using Jquery File Upload to upload images. Here's my current upload process:
- click "Add files" button and browse for files
- click the "Start upload" button and files are uploaded
Everything works fine, but I'm trying to skip point n.2 and upload files automatically when just after browsing. Looking inside documentation, I've found this option and setup the following snippet:
// Load existing files:
$.ajax({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: $('#fileupload').fileupload('option', 'url'),
dataType: 'json',
context: $('#fileupload')[0],
autoUpload: true
}).done(function (result) {
$(this).fileupload('option', 'done')
.call(this, null, {result: result});
});
Unfortunately, nothing happens after file browsing and I still have to press "Start upload" button to begin upload process. What am I missing?