Disable extension validation

Last post 08-07-2013, 8:28 PM by radmir. 4 replies.
Sort Posts: Previous Next
  •  08-06-2013, 7:48 AM 77817

    Disable extension validation

    Hi,

     How to disable extension validation?

  •  08-06-2013, 1:16 PM 77819 in reply to 77817

    Re: Disable extension validation

    Hi radmir,

     

    The extension validation only available when you set property "AllowedFileExtensions", so if you do not want it check the extension, just do not set this property.

     

     <CuteWebUI:UploadAttachments runat="server" ID="uploader1">

                <ValidateOption AllowedFileExtensions="jpg" />

     </CuteWebUI:UploadAttachments> 

     

    Regards,

     

    Ken 

  •  08-06-2013, 7:12 PM 77821 in reply to 77819

    Re: Disable extension validation

    Hi Ken,

     

    Thanks you for  the quick reply.

    I admit that I only tried upload file with .msi extension and for that one still get message "This file extension is not allowed! File extensions allowed: 'null'". 

    After your reply I tried other extensions and usually works fine. But if I want upload .xlsx file, the error message show again. Then I set  AllowedFileExtensions = "xlsx" and the message still show again (This file extension is not allowed! File extensions allowed: 'xlsx').  

     

    Usually works fine, but not for all extensions. 

    (I am using AjaxUploader on ASP.NET MVC platform)

     

    Regards,

    Radomir 

  •  08-07-2013, 1:23 PM 77825 in reply to 77821

    Re: Disable extension validation

    Hi radmir,

     

    Please check your handler file. We using "UploadHandler.ashx" in the demo, and has the AllowedFileExtensions setting there. did you just copied the demo handler file and use on your own site so did not remove the AllowedFileExtensions setting?

     

    option.AllowedFileExtensions = "*.jpg,*.gif,*.png,*.bmp,*.zip,*.rar,*.txt,*.exe,*.doc,*.docx,*.pdf,*.wmv"; 

     

    Regards,

     

    Ken 

  •  08-07-2013, 8:28 PM 77830 in reply to 77825

    Re: Disable extension validation

    Hi Ken,

     

    You right. I copy that handler from demo and forgot about it. Now everything is correct.

     

    Thank you,

     

    Radomir 

View as RSS news feed in XML