Extension Filters

You are able to specify the types of files that are displayed in the Browse dialog window. This is done by specifying extension filters and setting them to the Filter property of the RadUpload. The string value should have the following format - "Filter Name|extension1;extension2;...extensionN". Here is an example of a RadUpload control with a filter for image files.

Example 1: Setting a filter for image files

<telerik:RadUpload Filter="Image Files (.gif;.jpg;.jpeg;.png)|.gif;.jpg;.jpeg;.png" /> 
With this filter defined, only the files with these extensions will be displayed in the Browse dialog window.

Typically the filters make it easier for the user to find the file he wants to upload, but filters can also be used to limit the types of files, that can be uploaded. For example, if you have an Image Gallery, you will want only Image files to be uploaded.

If you need to define more than one filter, you concatenate the desired filters by separating them with "|".

Example 2: Setting multiple filters

<telerik:RadUpload Filter="Image Files (.gif;.jpg;.jpeg;.png)|.gif;.jpg;.jpeg;.png|All Files|." /> 

When having more than one filter, you can specify which to be the default by setting the FilterIndex property to the index of the desired filter (the indexing starts from 1).

See Also

In this article