C# File Download issue in Internet Explorer 6

S

Shifali

Hi,

I am using following code to download '.exe' file in c#. This code is
working fine in all other browsers but it gives error in IE6.0 as:

'Internet explorer can not download file from .Internet Explorer was not
able to open the site. The requested site is either unavailable or can not be
found.'

public void DownloadSetup()
{
String filePath =
Server.MapPath("./ABDownload/GulAktivBedrift.exe");
if (System.IO.File.Exists(filePath))
{
Response.ContentType = "application/exe";
Response.AddHeader("Content-Disposition", "attachment;
filename=" + System.IO.Path.GetFileName(filePath));
Response.Clear();
Response.WriteFile(filePath);
HttpContext.Current.ApplicationInstance.CompleteRequest();
//Response.End();
}
}

My c# code is as follows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top