Question

I have a silverlight application that retrieves a file from Amazon s3. At this point I am using a SaveFileDialog to save it to disk.

I am looking for a better way of saving the file.I have looked into and implemented Isolated storage but ultimately decided to not use it because of all the restrictions.

Also, silverlight restricts saving a file outside isolated storage without the save file dialog, so I cannot save a file and then pass the file path to the browser. so this is not possible

 HtmlPage.Window.Navigate(urlToFile, "_blank");

What are the options I have left now to pass this stream to a browser?

Was it helpful?

Solution

There is a feature in silverlight 4 where you can run it out of the browser. In this mode you have elevated permissions. The one that would be of most interest to you is

File system access. Trusted applications can access System.IO types and related types that are otherwise unavailable to Silverlight. These APIs provide direct read and write access to files in user folders on the local computer. For more information, see How to: Access the Local File System in Trusted Applications.

Outside of this, there is no other way to save a file to the users desktop without using the SaveFileDialog

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top