This is a migrated thread and some comments may be shown as answers.

Differing AllowedFileExtensions and SearchPatterns

4 Answers 170 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 02 Jun 2011, 08:40 PM
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

4 Answers, 1 is accepted

Sort by
0
Ed
Top achievements
Rank 1
answered on 06 Jun 2011, 05:35 PM
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.
0
Dobromir
Telerik team
answered on 07 Jun 2011, 02:21 PM
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.

0
jpazniokas
Top achievements
Rank 1
answered on 23 Apr 2012, 06:34 PM
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
0
Dobromir
Telerik team
answered on 24 Apr 2012, 09:06 AM
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.
Tags
FileExplorer
Asked by
Ed
Top achievements
Rank 1
Answers by
Ed
Top achievements
Rank 1
Dobromir
Telerik team
jpazniokas
Top achievements
Rank 1
Share this question
or