I need to write a web application that allows the client to download a file from the server, so far so good, but the file must be kind of encoded, so i need to decode it on the client and write it on a file on the client's PC.
Can i do this using Silverlight? and how?
If it is not possible, there is another way to do it?. Any suggestions?
Thanks
Edit: As exposed for Brian Genisio, i can ask for user permision to save the file, so i think that the open and save Dialogs are ok for my case. But in case that that's not enough, is there a way to, with or without user interaction, to save the file outside of the isolated storage, for example emulating a new download for the user?
In Silverlight 3.0, you will have access to read and write files via the OpenFileDialog. In Silverlight 2.0, you have access to Isolated Sotrage, which will let you save to a sandbox. You will probably never have full access to the file system without user permission, though.
You can use IsolatedStorageFile Class for this using silverlight.
Another link: How to Read and Write files in the Isolated Storage?
You cannot do this for security reasons:
Silverlight-based applications do not use the file system of the operating system and are restricted to using isolated storage to persist and access files, so this namespace [System.IO] does not provide any additional functionality. For more information about how Silverlight-based applications use isolated storage, see Isolated Storage.
If possible, you might want to shift it such that the server does the encoding and the file is made available for download in a traditional manner.
If you're encoding for privacy/security consider offering the download only on a secure protocol (HTTPS using SSL).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With