I had to add some nonsense to my webpage that would tell IIS to download the
file and not try to process
private void DownloadFile(string virtualPath)
{
string filePath = Server.MapPath(virtualPath);
FileInfo targetFile = new FileInfo(filePath);
// clear the current output content from the buffer
Response.Clear();
// add the header that specifies the default filename for the
download/saveas dialog
Response.AddHeader("Content-Disposition","attachment; filename=" +
targetFile.Name);
// add the header that specifies the file size so that the browser can show
the progress
Response.AddHeader("Content_Length",targetFile.Length.ToString());
// specify that th eresponse is a stream that cannot be read by the client
and must be downloaded
Response.ContentType = "application/octet-stream";
// send the file stream to the client
Response.WriteFile(targetFile.FullName);
// stop the execution of this page
Response.End();
}
hope this helps
[quoted text, click to view] "Michael Nemtsev" wrote:
> Hello tushar.n.patel@gmail.com,
>
>
> FW1.1 don't give u ability to do a such thing automatically.
>
> FW 2.0 supply ClickOnce to do it
>
> > i've made one .exe application in .net 1.1 and upladed to one
> > server. the problem is when i click on the link, instead of
> > downloading
> > it like normal exe file it is opening it. i want to download the exe
> > as
> > it also has some DLLs which needs to be deployed at client side b4
> > application starts.
> > anybody has any solution plz do share with me.
> > thanks
> >
> ---
> WBR,
> Michael Nemtsev :: blog:
http://spaces.msn.com/members/laflour >
> "At times one remains faithful to a cause only because its opponents do not
> cease to be insipid." (c) Friedrich Nietzsche
>
>