Silverlight: Stream files to a new HTML browser window to prompt the user to "open or save as ..."?

What would be the most efficient way, if possible, for streaming or sending a file (byte array) from a Silverlight application in a browser to a new HTML window so that the user can either open the default OS related application file or save the file?

I use the save file dialog so that they can save the file if necessary, but I have a requirement that if the user clicks on a file in my application, the standard open / save dialog of the operating system should pop.

+4
source share
2 answers

Since the file is on the server, why not allow the browser everything: -

HtmlPage.Window.Navigate(urlToFile, "_blank"); 
+2
source

It looks like your requirements are for a desktop application, not a Silverlight application. Ever watched ClickOnce ?

The most plausible way I can think of is to send the file to a remote server and then direct your user to that server. Most likely, this is not what you are looking for.

Then there is the opportunity to open the socket and effectively turn your Silverlight application into a server. Then open a new browser window and point it to localhost: portnum. However, you will need to implement some kind of protocol that the browser understands, such as FTP or HTTP. Which seems a little ridiculous.

+1
source

Source: https://habr.com/ru/post/1369013/


All Articles