John,
The easiest way to do what you are asking is to just create a link on the
page pointing to the file to download. (e.g. <a
href="Downloads/MyFile.pdf">Download MyFile.pdf</a>)
A link such as this will open a dialog box which will allow a user to open
or save the file. If they choose save then a dialog box allowing them to
choose where to save the file will open.
Since in your example you are using a .pdf file you should also know that,
depending on the way a user's adobe acrobat reader program is set up the
file may open in the browser window automatically. However, if they choose
file - save from the menu they will be able to save the downloaded file
wherever they want on their drive.
I hope this helps.
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"John Spiegel" <js******@YETANOTHERSPAMHATERc-comld.com> wrote in message
news:eb**************@tk2msftngp13.phx.gbl...
Hi all,
How does one allow a user to download a file WITH selecting where it
should be downloaded to on their machine? Also, when using the
WebClient.Download method, will the destination path written in Windows format (backslashes,
etc.) translate across client platforms? Is there a better way?
WebClient wc = new WebClient();
wc.DownloadFile(Server.MapPath(@"Downloads\MyFile. pdf"),
@"C:\Temp\TheirFile.pdf");
TIA,
John