content-dispositon, attachment and frames?

Discussion in 'ASP General' started by Johan Torstensson, Nov 8, 2004.

  1. Hi,

    I've noticed that IE6 on Windows Xp with SP2 sometimes closes the browser
    window after the open/save dialogue.

    The problem seems only to occur when using the header "Content-Disposition",
    "attachment; filename=thefilename.txt" and when the browser window is a
    child of another window and when the download link is on a page inside a
    frame.

    In my case the users log on to the system and from a portal-page they click
    their way to diffent projects, which are opened in new windows (making them
    childs of the "portal" browser window). The project page is a frameset. When
    downloading a file from here the browser window closes.

    The problem dissapears when loading the project page directly in a new
    browser, from a bookmark or if the user types the url manually. But this is
    not the general approach of my users, they come in using the portal, as it
    was intended.


    I've seen a few posts about similar problems here and there, but I've never
    seen any solutions. Anyone got any ideas?


    Thanks
    Johan
    Johan Torstensson, Nov 8, 2004
    #1
    1. Advertising

  2. Johan Torstensson

    Evertjan. Guest

    Johan Torstensson wrote on 08 nov 2004 in
    microsoft.public.inetserver.asp.general:

    > I've noticed that IE6 on Windows Xp with SP2 sometimes closes the
    > browser window after the open/save dialogue.
    >
    > The problem seems only to occur when using the header
    > "Content-Disposition", "attachment; filename=thefilename.txt" and when
    > the browser window is a child of another window and when the download
    > link is on a page inside a frame.
    >


    Where does ASP come in?

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)
    Evertjan., Nov 8, 2004
    #2
    1. Advertising

  3. "Evertjan." <> skrev i meddelandet
    news:Xns959B871BA8E74eejj99@194.109.133.29...
    > Johan Torstensson wrote on 08 nov 2004 in
    > microsoft.public.inetserver.asp.general:
    >
    >> I've noticed that IE6 on Windows Xp with SP2 sometimes closes the
    >> browser window after the open/save dialogue.
    >>
    >> The problem seems only to occur when using the header
    >> "Content-Disposition", "attachment; filename=thefilename.txt" and when
    >> the browser window is a child of another window and when the download
    >> link is on a page inside a frame.
    >>

    >
    > Where does ASP come in?
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Please change the x'es to dots in my emailaddress,
    > but let us keep the discussions in the newsgroup)
    >


    The download links are passed to a ASP-file initiating the download.

    Set objStream = Server.CreateObject("ADODB.Stream")
    Response.Expires = 0
    Response.Buffer = True
    Response.Clear
    Response.AddHeader "content-disposition", "attachment; filename=" & fileName
    Response.AddHeader "content-length", fileSize
    Response.ContentType = "application/octet-stream"
    objStream.Type = adTypeBinary
    objStream.Open
    objStream.LoadFromFile filePath
    Response.BinaryWrite objStream.Read
    Response.End

    I don't really believe it's an ASP-problem. I've tested different variations
    of content-types etc. with the same results. And the code does work, just
    not in the combinatioin of frames and windows that we have in our solution.
    I posted my problem in this group in hope to get a answer from other
    developers maybe experiencing the same problem. In the more general IE6
    groups I get answers like "disable norton antivirus" or a link on how to
    remove spyware.

    Johan
    Johan Torstensson, Nov 8, 2004
    #3
  4. Johan Torstensson

    Evertjan. Guest

    Johan Torstensson wrote on 08 nov 2004 in
    microsoft.public.inetserver.asp.general:

    > Response.AddHeader "content-disposition", "attachment; filename=" &
    > fileName Response.AddHeader "content-length", fileSize
    > Response.ContentType = "application/octet-stream"
    > objStream.Type = adTypeBinary
    > objStream.Open
    > objStream.LoadFromFile filePath
    > Response.BinaryWrite objStream.Read
    > Response.End
    >
    > I don't really believe it's an ASP-problem. I've tested different
    > variations of content-types etc. with the same results. And the code
    > does work, just not in the combinatioin of frames and windows that we
    > have in our solution. I posted my problem in this group in hope to get
    > a answer from other developers maybe experiencing the same problem. In
    > the more general IE6 groups I get answers like "disable norton
    > antivirus" or a link on how to remove spyware.
    >


    I gave up on

    Response.AddHeader "content-disposition", "attachment; filename=" &

    It seems that IE is not well diposed on that.


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)
    Evertjan., Nov 8, 2004
    #4
  5. "Evertjan." <> skrev i meddelandet
    news:Xns959B9460D9F9eejj99@194.109.133.29...
    > Johan Torstensson wrote on 08 nov 2004 in
    > microsoft.public.inetserver.asp.general:
    >
    >> Response.AddHeader "content-disposition", "attachment; filename=" &
    >> fileName Response.AddHeader "content-length", fileSize
    >> Response.ContentType = "application/octet-stream"
    >> objStream.Type = adTypeBinary
    >> objStream.Open
    >> objStream.LoadFromFile filePath
    >> Response.BinaryWrite objStream.Read
    >> Response.End
    >>
    >> I don't really believe it's an ASP-problem. I've tested different
    >> variations of content-types etc. with the same results. And the code
    >> does work, just not in the combinatioin of frames and windows that we
    >> have in our solution. I posted my problem in this group in hope to get
    >> a answer from other developers maybe experiencing the same problem. In
    >> the more general IE6 groups I get answers like "disable norton
    >> antivirus" or a link on how to remove spyware.
    >>

    >
    > I gave up on
    >
    > Response.AddHeader "content-disposition", "attachment; filename=" &
    >
    > It seems that IE is not well diposed on that.
    >
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Please change the x'es to dots in my emailaddress,
    > but let us keep the discussions in the newsgroup)
    >


    I just get this behavior on IE6 on Windows XP with SP2. It has worked on
    older versions of IE and it still works on IE6 on my Windows 2000 machine.

    The usage of the header is described here in this knowledge base:
    http://support.microsoft.com/kb/260519/EN-US/

    /johan
    Johan Torstensson, Nov 8, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Brennan

    File content / attachment fails in SSL

    Michael Brennan, Jul 7, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    377
    Michael Brennan
    Jul 7, 2003
  2. ben
    Replies:
    0
    Views:
    1,056
  3. =?Utf-8?B?R1JF?=
    Replies:
    1
    Views:
    3,394
    Craig Deelsnyder
    Aug 20, 2004
  4. Costas Andriotis
    Replies:
    0
    Views:
    1,122
    Costas Andriotis
    Oct 15, 2004
  5. hazz
    Replies:
    6
    Views:
    49,433
    SkyUCHC
    Jun 9, 2010
Loading...

Share This Page