Silverlight 2.0 - Saving to Text File

I would like to save some simple text data to a file from my Silverlight application - a CSV file.

The user clicks a button, the code generates the contents of the file in memory (string), then a prompt appears to either open the file or Save to disk, for example via a regular web page.

I found a tricky way to do this: http://pagebrooks.com/archive/2008/07/16/save-file-dialog-in-silverlight.aspx

But wondered if there was an easier way? Especially with the recent release of Silverlight 2.0.

Thank.

+1


source to share


3 answers


Silverlight 2 currently does not support saving directly to the user's disk, even with a prompt. This is a feature considered for future releases, but working around the server pushing data out is the current solution.



+3


source


Just update this thread - Silverlight 3 now has this capability.



+1


source


I am doing this now with Silverlight 2.0, but the key is that the files are saved on the web server that hosts the Silverlight applications using the Silverlight Application Web Services.

Probably not what you are looking for, but it is an option.

  • Silverlight application calls a web service that dispatches a string
  • The web service saves the string as a file on the server
  • The file is accessible through a web application or other means.
0


source







All Articles