Rad Asynch File Upload Problem

2 posts, 0 answers
  1. Arvind
    Arvind avatar
    40 posts
    Member since:
    Sep 2010

    Posted 04 May 2012 Link to this post

    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.
  2. Plamen
    Admin
    Plamen avatar
    2959 posts

    Posted 09 May 2012 Link to this post

    Hello Arvind,

     
    You can refer to this forum thread where similar issue have been discussed.

    Hope this will be helpful.

    Regards,
    Plamen Zdravkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top