PC Review


Reply
Thread Tools Rate Thread

C# File Download issue in Internet Explorer 6

 
 
Shifali
Guest
Posts: n/a
 
      12th Mar 2009
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
--
Thanks,
Shifali
 
Reply With Quote
 
 
 
 
PA Bear [MS MVP]
Guest
Posts: n/a
 
      13th Mar 2009
IE Developer Center
http://msdn.microsoft.com/en-us/ie/default.aspx

Learn IE
http://msdn.microsoft.com/en-us/ie/aa740473.aspx

HTML and DHTML Overviews and Tutorials
http://msdn.microsoft.com/en-us/library/ms537623.aspx and

Cascading Style Sheets (CSS)
http://msdn2.microsoft.com/en-us/ie/aa740476.aspx

Or you could post here instead:

MSDN IE Development Forums
http://forums.microsoft.com/MSDN/def...D=253&SiteID=1

Shifali wrote:
> 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


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IE 6.0 Unable to Download files - Attempting to When you attempt to download a file from a Web site, the Copying dialog box may appear ... Internet Explorer Window Closes When You Click a Download Link . Robert Cox Windows XP Internet Explorer 6 5th Sep 2007 09:08 PM
Internet Explorer File Download Dialogue Box - Please Help! Steve Nicholls Windows XP Networking 1 27th Jan 2004 12:39 AM
Can't download *.rar file with Internet Explorer NeoNeo Windows XP Internet Explorer 4 3rd Jan 2004 02:39 AM
Can not use internet explorer to download a file jb Windows XP Internet Explorer 0 4th Sep 2003 01:14 AM
Internet Explorer cannot download any file from any URL J. RYAN Windows XP Internet Explorer 0 27th Aug 2003 10:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:37 AM.