Skip to main content
Home Forums General Silverlight Getting Started download a zip file to user computer
2 replies. Latest Post by ScCrow on December 17, 2008.
(0)
ScCrow
Member
44 points
107 Posts
12-16-2008 9:17 PM |
I have a helper class/project in my solution. In its dir is a subdir named "Resources" which holds various files, one is a .zip. In the Class, I have a method that is called to create a PopUp window to do a download and allow a user to save the zip to their computer. Below are just a couple of the attempts
I cant seem to get the Uri correct.
bryant
Star
9937 points
1,629 Posts
12-17-2008 11:00 AM |
I don't believe that is going to work. The problem is that Silverlight can only download things to the user's computer from the server, not from the xap file that is local. So you're trying to navigate to a file that is already downloaded and on the local machine.
If you really need this to be deployed with the Silverlight xap, you could write some server code for application_start that would check to see if the zip file existed locally and if it didn't you would break open the xap file (as a zip file) and extract the zip file to a local folder on the web server.
12-17-2008 2:59 PM |
Bryant
Its one of those newbee errors. I was thinking that the resource was on the server. Obviousely not. Duh!
Ive done this with asp.net pages, but not from Silverlight. It doesnt have to be in Silverlight,,, just initiated when the user clicks a download button. Sooo, I need a quick re-think. If anyone has a link to a sample, it would save some time.
Thanks