.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Internet Explorer problems downloading files from IIS 6 - Response.AddHeader("content-disposition",

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :ASP.Net
I'm retrieving a file from my DB, storing in a Byte[] variable. In my local development environment, Visual Studio 2008, the file download works great in all browsers (IE, Firefox, and Chrome).But, when running on external IIS 6.0 web server, IE 7 and IE 8 browsers will not properly download files: the indicated file name seems to default to my ASPX page "[template].aspx" , not the file name that I specify in the Response.AddHeader(...).  FIREFOX and CHROME download all files, all MIME types JUST FINE with the correct file name. This problem occurs only in IE? (Several clients all tested with same results.) Is there a disconnect between IE and IIS 6.0 in how the response headers are interpreted? Is there another header attribute needed for IE?My code:    Response.Clear();    Response.ClearHeaders();    Response.Buffer = true;    Response.ContentType = f.MimeType;    Response.AddHeader("content-disposition", "attachment; filename=\"" + f.Name + "." + f.Extension+"\"");    Response.Charset = "";    Response.Cache.SetCacheability(HttpCacheability.NoCache);    Response.BinaryWrite(f.File);    Response.End();Thanks.

View Complete Post

More Related Resource Links

Internet Explorer 8: New Features To Slice, Store, And Accelerate Your Web Applications


Internet Explorer 8 sports some exciting new features including Web Slices, Accelerators, and search suggestions along with AJAX navigation and DOM storage.

Daron Yöndem

MSDN Magazine March 2009

The ASP Column: Using the Internet Explorer WebControls


During the lifespan of ASP, there have been many technologies developed for making browser-based user interface development easier. For example, during the early days of classic ASP development, keeping a browser-based UI consistent required many conditional statements into the ASP script.

George Shepherd

MSDN Magazine February 2003

DIME: Sending Files, Attachments, and SOAP Messages Via Direct Internet Message Encapsulation


Direct Internet Message Encapsulation (DIME) is a new specification for sending and receiving SOAP messages along with additional attachments, like binary files, XML fragments, and even other SOAP messages, using standard transport protocols like HTTP. In this article, the author explains what DIME is and how it differs from MIME encapsulation. A detailed description of the message format and how it is parsed, as well as working with SOAP and extending it with WSDL, is also included.

Jeannine Hall Gailey

MSDN Magazine December 2002

DHTML and .NET: Host Secure, Lightweight Client-Side Controls in Microsoft Internet Explorer


In the past, Web developers often used ActiveX controls if they wanted customized client-side functionality incorporated into their Web applications. Now, they can build objects supported by the Microsoft .NET Framework which are more compact, lightweight, secure, and seamlessly integrated. By hosting .NET Windows Forms controls in Internet Explorer, developers can realize many of their client-side Web development goals. This article adapts ActiveX concepts for use with Windows Forms, and builds a multifile upload application that demonstrates these techniques.

Jay Allen

MSDN Magazine January 2002

Graphics: Manipulate Digital Images in Internet Explorer with the DirectX Transform SDK


The Microsoft DirectX Transform is a Microsoft DirectX media API that can be used to create animated effects as well as to create and edit digital images for Windows-based applications. Scripting and HTML can be used to display an existing transform on a Web page, and improved transform support in Microsoft Internet Explorer 5.5 makes it easy to use transforms. This article provides step-by-step instructions for writing a transform as an ATL project and shows an example of an image transform. C++ is used to instantiate, configure, and display transforms in this project.

Alex Lerner

MSDN Magazine March 2001

Digital Dashboards: Web Parts Integrate with Internet Explorer and Outlook to Build Personal Portals


Digital dashboards gather information and functionalities from a wide variety of sources ranging from Web pages to applications such as Microsoft Outlook and SQL Server, and present the resulting information in a single user interface. Digital dashboards built with the Digital Dashboard Resource Kit (DDRK) are made up of distinct units called Web Parts. Web Parts, introduced with the DDRK 2.01, can contain any Web-based information, are reusable, and integrate with each other and with other dashboards. Creating Web Parts and getting them to work together is illustrated via a sample application that uses a PivotTable view. Integrating Web Parts with Outlook, the Outlook View control, storage, and debugging are also covered.

Maarten Mullender

MSDN Magazine January 2001

More Windows 2000 UI Goodies: Extending Explorer Views by Customizing Hypertext Template Files


The Web-style interface is the default Explorer folder view for the Desktop Update in Windows 2000. The Desktop Update uses HTML-based hypertext templates to create the Web view, and you can customize these templates to include your own views and commands. This article shows you how the Explorer Web view works and how to build your own custom templates for it. You'll see how to add a command prompt and task buttons to a new folder view using HTML, script, and ActiveX controls. The shell object model and thumbnail shell extensions are also examined, then used to build a simple icon viewer for Explorer.

Dino Esposito

MSDN Magazine June 2000

Response.TransmitFile() Firefox problems


My company is in the final development stages for a web application that includes a couple of features that allow for uploading and downloading user document files.  We've recently identified a problem in these features when users download and view a document in Firefox.  The download and viewing work fine, but as soon as the user closes the document and attempts to navigate to a different page in the application, Firefox throws up a page that says:

 XML Parsing Error: not well formed

Location: (URL of page)

Line number: X, Column: X

[a snippet of markup from the page]


I've tried numerous variations on the code we're using to do the download, but they all center on the following:


        string path = Server.MapPath(UIUtils.GetRepositoryPath(custNm)) + fileId + ArtifactRevision.FileExt;
        FileInfo file = new FileInfo(path);
        if (!file.Exists)
            throw new ApplicationException("Missing repository file");

        fileName = fileName.Replace(' ', '_');
        Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
        Response.AddHeader("Content-Length", file.Length.ToString());
        Response.ContentType = contType;

Problems downloading .NET Framework

My OS is XP Home. I only have .NET Framework 1.1 SP2 and .NET Framework 4. I am missing versions 2.0 through 3.5.  I need to load Visual Basic 2008 on my computer but kept getting an error because .NET Framework 3.5 could not be loaded. I try to download 3.5 but found I only have .NET Framework 1.1 SP2 and I am missing versions 2.0 through 3.5.  My computer continues to give me errors when attempting to download these versions but I think it spans from not having the original .NET Framework 2.0.  I cannont find the just 2.0 online. I had downloaded version 4 with no problem previously, and because this was for a class I'm using a trial version of Visual Basics 2010 which works fine but about to end. Does anyone know where or how I can load this original 2.0 version?  Appreciate any help. Jaycatt30

CSS font is working in FireFox but not in Internet Explorer 8.0

Hi All, I tried a lot but I could not figure out why the IE is not taking font size and name in to effect from CSS. In firefox my website could be seen very nice but in IE it is little bit unshiny and font size is bigger For the difference which I am talking about could be seen  if your PC have both firefox and IE installed. Please go to http://www.nymidtowndentistry.com open it in FF and IE and you could see the font and alignment related change. All these settings are in body element of CSS. Do you any idea regarding this? Any help would be appreciated. Thanks for your time. -Hitesh  

Polling FTP-Server and downloading files to our local directory on regular intervals

Issue regarding downloading same file again and again. Let me be clear, I am using SSIS to poll FTP Server on regular intervals to download different files to my local directory. Once the file is downloaded I need to load the file name into table and validate that particular file name against FTP Server next time when I am polling, so that I don't download same file again.                              Question here is how could I implement this either using SSIS or VB Script ???

internet explorer closes. I can't get my e-mail to open a comment from facebook

when I try to open my internet explorer it either won't open at all or it workd for awhile then it crashes. I was able to open my yahoo mail and open facebook comments from the yahoo e-mail but it never connects 

Javascript Error in Internet Explorer but works fine in Firefox

Hi All,i was working on one of the project as it is working fine in Firefox but it is giving the javascript exception in internet explorer.Errror:  Error says  "s" is undefined in the s.currencyCode="USD" line but "s" is defined in the external javascript file  s_code.jsCan anyone suggest the solution for this issue:Please find my code where the error is displayed <script type="text/javascript" language="JavaScript" >var s_account="mnsdev"</script><script type="text/javascript" language="JavaScript" src="http://media.world.com/ads/usen/rpt/Omniture/s_code.js"></script><script type="text/javascript" language="JavaScript" >s.currencyCode="USD"s.charSet="ISO-8859-1"s.SEMct = s.getQueryParam('s_kwcid');s.SEMct = s.getValOnce(s.SEMct,'SEM_ct',0);s.clickPast(s.SEMct,'event9','event10');s.SEMvar=s.getQueryParam('s_kwcid');s.SEMdate=new Date;s.SEMdate.setTime(s.SEMdate.getTime()+60*86400000)if(s.SEMvar){s.c_w('SEM_ck','1',s.SEMdate)}s.SEMchk=s.c_r('SEM_ck');if(s.SEMchk&&s.events)s.SEMok='ok';if(s.SEMvar||s.SEMok) s.t()

overwrite the files in document library from Explorer View ?

Hi Everyone, Suppose I have a document library which can be opened using the explorer view, what happened if someone uploads to this library by drag n drop into the library with same filename? What would be the final story of the file which is overwritten through drag n drop from Explorer view ? Thanks./* Infrastructure Support Engineer */
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend