Disallow File List?

3 posts, 0 answers
  1. Jimmy Hill
    Jimmy Hill avatar
    9 posts
    Member since:
    Nov 2007

    Posted 02 Mar 2010 Link to this post

    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. Ivan
    Admin
    Ivan avatar
    519 posts

    Posted 08 Mar 2010 Link to this post

    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.
  3. DevCraft banner
  4. Jimmy Hill
    Jimmy Hill avatar
    9 posts
    Member since:
    Nov 2007

    Posted 09 Mar 2010 Link to this post

    That will work just fine. Thanks very much!
Back to Top