Monday 24 September 2012

Silverlight - Local File System Access


I just made a quick test if the local file System can be accessed by Silverlight 5.0 In- Browser application and Out-of-Browser.

Good news is yes; now its possible in both the cases. Only requirement is you should check the require elevated trust while running In Browser or Out of Browser.

Find attached the sample application - Here I am accessing My Pictures. So to see something create folder here and copy some images. You should the screen like below -



Note: 
1. Earlier to Silverlight 5 i.e Silverlight 4 : If Silverlight is running within the browser or Out-Of-Browser in normal mode, then file access is limited to usage of theOpenFileDialog and SaveFileDialog controls. In both cases, the user is presented with a prompt to load (or save) a file, and the Silverlight application only has access to the file’s stream containing it’s data, not to the file structure itself.

2. It was only limited to trusted location like My Documents folder, means it was only possible to read/write in My Documents if application is running Out-of-Browser. Now using Silverlight 5 you can do such operation in any files or folders.

3. Also, befor silverlight 5.0 require elevated trust was available only with the Out-of-Browser.

2 comments:

  1. Your blog has given me that thing which I never expect to get from all over the websites. Nice post guys!

    Web Developer Melbourne

    ReplyDelete
  2. outsourcingall.com "Usually I never comment on blogs but your article is so convincing that I never stop myself to say something about it.
    This paragraph gives clear idea for the new viewers of blogging, Thanks you. You’re doing a great job Man, Keep it up.
    web hosting service in bangladesh

    ReplyDelete