Hi Telerik Team,
I am using the RadAsncFileUpload control to upload files and save them them in Database, I have kept the filter for RadAsncFileUpload to allow only word documents, but when i attach other type of the files it shows them as an invalid files but when I click on save button to upload files it does not throw me any error, and does not save in database.
Please help me what should I do in order to validate the RadAsncFileUpload before saving the file in database.
I have tried the following code:
<telerik:RadScriptBlock ID="rcb" runat="server">
<script type="text/javascript">
function DeleteInvalidFiles() {
debugger;
var upload = $find("<%= RadAsyncFile_Upload.ClientID %>");
var inputs = upload.getUploadedFiles();
for (i = inputs.length - 1; i >= 0; i--) {
if (!upload.isExtensionValid(inputs[i].value))
upload.deleteFileInputAt(i);
}
}
</script>
</telerik:RadScriptBlock>
Thanks,
Arvind.
I am using the RadAsncFileUpload control to upload files and save them them in Database, I have kept the filter for RadAsncFileUpload to allow only word documents, but when i attach other type of the files it shows them as an invalid files but when I click on save button to upload files it does not throw me any error, and does not save in database.
Please help me what should I do in order to validate the RadAsncFileUpload before saving the file in database.
I have tried the following code:
<telerik:RadScriptBlock ID="rcb" runat="server">
<script type="text/javascript">
function DeleteInvalidFiles() {
debugger;
var upload = $find("<%= RadAsyncFile_Upload.ClientID %>");
var inputs = upload.getUploadedFiles();
for (i = inputs.length - 1; i >= 0; i--) {
if (!upload.isExtensionValid(inputs[i].value))
upload.deleteFileInputAt(i);
}
}
</script>
</telerik:RadScriptBlock>
Thanks,
Arvind.