User1724605321 posted
Hi Rjk_P,
how to do it with AjaxFileUpload control
You could refer to this thread:
http://forums.asp.net/t/1940946.aspx?how+to+set+size+limit+for+ajaxfileupload .
Client side size limit :
<script type="text/javascript">
function UploadComplete(sender, args) {
var filesize = args.get_fileSize();
var fileId = args.get_fileId();
var status = document.getElementById('AjaxFileUpload1_FileItemStatus_' + fileId);
var container = document.getElementById('AjaxFileUpload1_FileInfoContainer_' + fileId);
if (filesize > 72000) { // same condition used for server side
document.getElementById('lblStatus').innerText = "error";
if (status.innerText) {
status.innerText = " (Error)";
}
if (status.textContent) {
status.textContent = " (Error)";
}
container.style.color = 'Red';
}
}
</script>
You could also refer to links below for more details:
http://stackoverflow.com/questions/17865119/how-to-check-file-size-of-each-file-before-uploading-multiple-files-in-ajaxtoolk .
https://ajaxcontroltoolkit.codeplex.com/documentation .
Best Regards,
Nan Yu