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

Disallow File List?

2 Answers 31 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Jimmy Hill
Top achievements
Rank 1
Jimmy Hill asked on 02 Mar 2010, 06:32 PM
I would like to allow users to upload every type of file except .exe files. I can find no way of doing this with the upload control. Am I missing something?


Thanks in advance,
Jimmy

2 Answers, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 08 Mar 2010, 09:35 AM
Hi Jimmy Hill,

Thank you for contacting us.

The Silverlight's OpenFileDialog doesn't support the exclusion mask mechanism. However you can use the FilesSelected event to filter the selected files:

public MainPage()
{
    InitializeComponent();
    // RadUpload radUpload;
    radUpload.FilesSelected += new EventHandler<FilesSelectedEventArgs>(ru_FilesSelected);
}
 
void ru_FilesSelected(object sender, FilesSelectedEventArgs e)
{
    foreach (RadUploadSelectedFile file in e.SelectedFiles)
    {
        // file.Name
        // file.File - System.IO.FileInfo
    }
}

Please try the suggested approach and let us know if you have other questions.

Sincerely yours,
Ivan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jimmy Hill
Top achievements
Rank 1
answered on 09 Mar 2010, 06:58 PM
That will work just fine. Thanks very much!
Tags
Upload
Asked by
Jimmy Hill
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Jimmy Hill
Top achievements
Rank 1
Share this question
or