$(\'#fileupload\')
.fileupload({
acceptFileTypes: /(\\.|\\/)(jpg)$/i
})
.on(\'fileuploadadd\', function (e, data) {
console.log(data.file
This is what you want to do with the newer version of the plugin (9.11.2):
Include this files:
- jquery.ui.widget.js
- jquery.iframe-transport.js
- jquery.fileupload.js
- jquery.fileupload-process.js
- jquery.fileupload-validate.js
$('#fileupload')
.fileupload({
acceptFileTypes: /(\.|\/)(jpg)$/i
})
.on('fileuploadadd', function (e, data) {
console.log('validation object not available at this point. Do not do submit here');
})
.on('fileuploadprocessalways', function (e, data) {
console.log(data.files.error);//true if error
console.log(data.files[0].error);//error message
if(!data.files.error) data.submit(); //do submission here
});