Changing AllowedFileExtensions and FileFilters in codebehind

2 posts, 0 answers
  1. Esteban
    Esteban avatar
    3 posts
    Member since:
    Apr 2012

    Posted 23 Apr 2012 Link to this post

    Hi,

    I am trying to filter the allowed files to upload depending on the media library that has been selected. (docs, images, videos, etc)

    I have the radasyncupload control in a modal window. Switching between media categories is done with a button for each cat. I tried to change the AllowedFileExtensions property there for each media type but it didn't work. Should I set it somewhere else?

    Also, how could I change FileFilter description and extensions in codebehind? is it even possible? i tried using Eval("desc/ext") but I have must missed something. 


    <FileFilters>
      <telerik:FileFilter Description="Images(jpg;jpeg;png;gif)" Extensions="jpg,jpeg,png,gif" />
    </FileFilters>

    Any suggestions would be appreciated it. I am thinking in doing a radasyncupload control for each media type and just hide/display accordingly but I would like to avoid that.

    Thanks
  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1268 posts

    Posted 26 Apr 2012 Link to this post

    Hello Esteban,

    In general we strongly recommend using the AllowedFileExtensions property instead of the FileFilters. I've prepared a sample page showing how to change the AllowedFileExtensions dynamically upon button clicking.

    All the best,
    Dimitar Terziev
    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.
Back to Top