This project has moved and is read-only. For the latest updates, please go here.

File Filter from Database

Feb 11, 2011 at 10:48 AM

hi all...!!!

i want to specify FileFilter setting for my Silverlight Uploader dynamically,
i.e. i want to store the allowed file formats in my database and add them to my control on run time, i.e. from the code behind.

pls suggest..

Feb 11, 2011 at 10:54 AM


That's really easy.

In your HTML, you have this string for the InitParams for the Silverlight Multi File Uploader:
InitParameters ="MaxFileSizeKB=1000,MaxUploads=2,FileFilter=,CustomParam=1,DefaultColor=LightBlue"

FileFilter= is what you should fill with your databases values.

Example: Jpeg (*.jpg) |*.jpg

If you use MVC, it might look like this:
InitParameters ="MaxFileSizeKB=1000,MaxUploads=2,FileFilter=<%= Model.FileFilter%>,CustomParam=1,DefaultColor=LightBlue"