Skip to content

Instantly share code, notes, and snippets.

@roulupen
Last active December 22, 2015 10:58
Show Gist options
  • Save roulupen/6462071 to your computer and use it in GitHub Desktop.
Save roulupen/6462071 to your computer and use it in GitHub Desktop.
$('#selectedFiles-edit-win').kendoUpload({
multiple: true,
localization: {
select: 'Select File(s)'
},
async: {
saveUrl: "/CFCS/AjaxFactory.cfc?method=uploadFile",
removeUrl: "/CFCS/AjaxFactory.cfc?method=cancelUploadedFile",
autoUpload: true
},
select: function(e) {
var files = e.files;
if( files.length > 10 ) {
alert("Maximum 10 files can be uploaded at a time.");
e.preventDefault();
return false;
}
for(var fileCntr = 0; fileCntr < files.length; fileCntr ++) {
if( files[fileCntr].size > 10485760 ) {
alert("File size more than 10MB can not be uploaded.");
e.preventDefault();
return false;
}
if( files[fileCntr].extension.toLowerCase() == '.exe' ) {
alert("Executable files can not be uploaded.");
e.preventDefault();
return false;
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment