I don\'t see an option in the plupload API docs on restricting the number of files uploaded, to any number, even 1.
Doc fail? or Feature fail? If it doesn\'t exist I\'ll
Allow only one file to be uploaded:
uploader.bind('FilesAdded', function(up, files) {
$.each(files, function(i, file) {
if(uploader.files.length!=1){uploader.removeFile(file); return;}
});
});
Allow one file to be selected at once:
uploader.bind('FilesAdded', function(up, files) {
$.each(files, function(i, file) {
if(i){up.removeFile(file); return;}
});
});
Allow one file to upload at once:
uploader.bind('FilesAdded', function(up, files) {
$.each(files, function(i, file) {
if(uploader.files.length!=1){uploader.removeFile(file); return;}
});
});
uploader.bind('FileUploaded', function(up, file,response) {
up.removeFile(file);
});