Last active
December 22, 2015 10:58
-
-
Save roulupen/6462071 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#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