Filter files/Change Name/Show specific files

2 posts, 0 answers
  1. iomega 55
    iomega 55 avatar
    64 posts
    Member since:
    Dec 2004

    Posted 28 Nov 2009 Link to this post


    I need to have this:

    1) Upload *.jpg, *.pdf, *.doc, *.docx, *.xls
    2) Change the file name during the upload, ie if the filename is some.jpg at the end I need 12345some.jpg
    3) In the grid only show 12345*.* files
    4) Only show the grid, toolbar,contextmenu
    5) Manage codebehind during a callback the permission for upload, delete

    How can I do this?

    Thanks in advance.
  2. Fiko
    Fiko avatar
    1406 posts

    Posted 02 Dec 2009 Link to this post

    Hello Iomega,

    In reference to your questions:
    1. You need to set the SearchPaternsProperty of the RadFileExplorer control:
      RadFileExplorer1.Configuration.SearchPatterns = new string[] { "*.jpg", "*.pdf", "*.doc", "*.docx", "*.xls" };
    2. You need to implement a custom content provider and override the StoreFile method. That method is called when a file us uploading. In your case I recommend you to subclass the FileSystemContentProvider class.
    3. I believe that this KB article will be of help
    4. You can use this code in order to achieve the desired result:
      RadFileExplorer1.VisibleControls = Telerik.Web.UI.FileExplorer.FileExplorerControls.Grid |
                                         Telerik.Web.UI.FileExplorer.FileExplorerControls.Toolbar |
    5. Page_Load is the latest event, where you can set the paths properties of the RadFileExplorer control. The code should looks like this:
      protected void Page_Load(object sender, EventArgs e)
          string[] paths = new string[] { "~/images/", "~/documents/" };
          RadFileExplorer1.Configuration.ViewPaths = paths;

    I hope this helps.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top