HI,
I have a requirement of validating the file size in the client side. I went through the Telerik documentation, i got to know that i need to add
<telerik:RadProgressManager runat="server" id="RadProgressManager1" />
<telerik:RadProgressArea runat="server" id="RadProgressArea1"
OnClientProgressUpdating ="CheckUploadedFilesSize" DisplayCancelButton="True"/>
in addition to the radupload control.
I have included the javascript as below as well for validating the file size:
function CheckUploadedFilesSize(progressArea, args) {
//progressArea.Confirmed is a custom variable,
// you can use another if you want to
if (!progressArea.Confirmed && args.ProgressData.RadUpload.RequestSize > 1000000) {
if (confirm("The total size of the selected files is more than the limit." +
" Do you want to cancel the upload?")) {
progressArea.CancelRequest();
}
else {
progressArea.Confirmed = "confirmed";
}
}
}
I modified the web.config to accommodate the RadProgressManager and RadProgressArea as per the documentation.
Strangely the RadProgressManager is not getting displayed. The javascript is also not getting triggered. I am checking with a larger file size as i am aware that i wont be able to see the RadProgressManager for smaller ones.
Please let me know if i am missing something?
Regards,
Damodar
I have a requirement of validating the file size in the client side. I went through the Telerik documentation, i got to know that i need to add
<telerik:RadProgressManager runat="server" id="RadProgressManager1" />
<telerik:RadProgressArea runat="server" id="RadProgressArea1"
OnClientProgressUpdating ="CheckUploadedFilesSize" DisplayCancelButton="True"/>
in addition to the radupload control.
I have included the javascript as below as well for validating the file size:
function CheckUploadedFilesSize(progressArea, args) {
//progressArea.Confirmed is a custom variable,
// you can use another if you want to
if (!progressArea.Confirmed && args.ProgressData.RadUpload.RequestSize > 1000000) {
if (confirm("The total size of the selected files is more than the limit." +
" Do you want to cancel the upload?")) {
progressArea.CancelRequest();
}
else {
progressArea.Confirmed = "confirmed";
}
}
}
I modified the web.config to accommodate the RadProgressManager and RadProgressArea as per the documentation.
Strangely the RadProgressManager is not getting displayed. The javascript is also not getting triggered. I am checking with a larger file size as i am aware that i wont be able to see the RadProgressManager for smaller ones.
Please let me know if i am missing something?
Regards,
Damodar