Hi All,
Is there any way to get the total files size (upload size) in radasyncupload ? My requirement is,
I need to put multiple file RadAsyncUpload in my page. And have a total upload size limit (size of all files.) of 100 MB. When it reach the limit of 100 MB, it should display an error message and stops the uploading.
The code I tried,
This code is failing with an error "DOM is disabled".
Is there any way to do this?
Is there any way to get the total files size (upload size) in radasyncupload ? My requirement is,
I need to put multiple file RadAsyncUpload in my page. And have a total upload size limit (size of all files.) of 100 MB. When it reach the limit of 100 MB, it should display an error message and stops the uploading.
The code I tried,
<telerik:RadAsyncUpload runat=
"server"
ID=
"AsyncUpload1"
HideFileInput=
"true"
Skin=
"Hay"
MultipleFileSelection=
"Automatic"
AllowedFileExtensions=
".jpeg,.jpg,.png,.doc,.docx,.xls,.xlsx,.rar,.zip,.txt,.dll,.pdf"
OnClientFileUploadFailed=
"onUploadFailed"
OnClientFileSelected=
"onFileSelected"
OnClientFileUploaded=
"onFileUploaded"
OnClientProgressUpdating=
"checkUploadedFilesSize"
/>
function
OnFileUploaded(sender, args) {
DecrementUploadsInProgress();
var
totalBytes = 0;
var
numberOfFiles = sender._uploadedFiles.length;
if
(isDuplicateFile) {
sender.deleteFileInputAt(numberOfFiles - 1);
isDuplicateFile =
false
;
sender.updateClientState();
alert(
"You can't add the same file twice"
);
return
;
}
for
(
var
index
in
filesSize) {
totalBytes += filesSize[index];
}
if
(totalBytes > MAX_TOTAL_BYTES) {
sender.deleteFileInputAt(numberOfFiles - 1);
sender.updateClientState();
alert(OVERSIZE_MESSAGE);
}
}
This code is failing with an error "DOM is disabled".
Is there any way to do this?