0
You're right HREF would work, but I want to download multiple files after they have been selected by the user. I do not want the user to click on links repeatedly. Once they specify the folder, it should download all the files.
Thanks,
-rajeev (rdubey)
0
grrr.... stupid HTML interpreting forums... :)
put this in an A tag
href="\mydownload.zip"
0
Sorry, in my earlier post I meant that its running Server side, which sounds like its the case. As far as starting the download automatically, you should be able to do that directly with an HREF...
click me and it shoudl prompt him to save that locally.
0
The code is part of a web form.
I intend to use it to automate the process of downloading multiple files by executing it in a loop after the web site user has selected all the files he wants to download.
Once he presses the start download button and specifies the folder in which to copy the files on his computer, the files should get copied to his spcified folder.
-rajeev (rdubey)
0
Is this code running as part of a Web Method? If so, thats running client side. That might cause the issue you're having.
-James
0
Hi James, thanks for the response.
I tried this way too. The problem remains. The point is that the file gets downloaded to the machine on which the above code is located.
What I mean is:
Webserver1: hosting the above code
ClientComputer1: Invoking the website hosted on Webserver1 having the above code.
Result:
The file gets copied to Webserver1 rather than the desired effect of downloading it to ClientComputer1.
I hope I made it clear. Any clues on how to get right?
0
Here is a code sample of mine that works fine to download from a server... It may help
///
/// Download the specified file from the uri
///
///
The resource location of the file to be downloaded
///
the name od the local file to save the download to
private void GetFile(string uri, string file)
{
try
{
WebClient tmpwc = new WebClient();
tmpwc.DownloadFile(uri + file, file);
}
catch(System.Net.WebException)
{
// Download failed
}
catch(Exception ex)
{
throw(ex);
}
}