Differing AllowedFileExtensions and SearchPatterns

5 posts, 0 answers
  1. Ed
    Ed avatar
    14 posts
    Member since:
    Dec 2010

    Posted 02 Jun 2011 Link to this post

    I'm using a RadFileExplorer control to allow users to browse folders and files on the site. I want them to be able to view only certain extensions, so I'm using the .Configuration.SearchPatterns property to successfully control what they can view. I want them to be able to view about 15 different types of files and that's working great. I only want them to be able to upload 13 of those types (no .aspx or .asp files, please). I can keep those types of files from uploading in the .ItemCommand, but when the user chooses to upload a file, it indicates that they can upload .aspx and .asp files in the upload dialog box under the File externsions allowed.

    How can I change this list so it doesn't show those two extensions?

    I'd imagine this can't be that uncommon of a situation, so my suggestion is that in a future update you add a .Configuration.UploadAllowedFileExtensions option that would be handed to the .Upload control
  2. Ed
    Ed avatar
    14 posts
    Member since:
    Dec 2010

    Posted 06 Jun 2011 Link to this post

    I wound up changing the upload text to remove listing those two extensions, but they still can upload those files - right now, I'm just catching it on the back end.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 07 Jun 2011 Link to this post

    Hi Edward,

    At present, it is not possible to configure RadFileExplorer do allow upload of file types different that displayed file types. To achieve the required functionality you can use the following approach:
    1. Configure RadFIleExplorer to display the required file types - by setting SearchPatterns property
    2. Handle RadFileExplorer's ItemCommand server-side event and cancel it if the uploaded file is not the correct type.
    3. On the client handle the upload dialog and manually modify the info panel's text to remove unwanted extensions.

    For your convenience I have attached a sample page implementing the above mentioned approach.

    Kind regards,
    Dobromir
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  5. jpazniokas
    jpazniokas avatar
    5 posts
    Member since:
    Jul 2007

    Posted 23 Apr 2012 Link to this post

    Hello, Dobromir.

    I just came across this issue myself.  Is your attached workaround still the recommended method for Edward's (and my) functionality?

    Thanks.

    John
  6. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 24 Apr 2012 Link to this post

    Hi John,

    Yes, this is the recommended approach to implement the required functionality.

    Greetings,
    Dobromir
    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
UI for ASP.NET Ajax is Ready for VS 2017