Empty window after file download with Content-Disposition

Discussion in 'ASP .Net' started by gluggi@bigfoot.com, May 3, 2006.

  1. Guest

    Hi,
    I have a small problem when I try to save a file. In an ASPX page in
    the Page_Load method I do something like that: (VB)

    Response.ClearHeaders()
    Response.AddHeader("Content-Disposition", "attachment;
    filename=foo.jpg")
    Response.Clear()
    Response.ContentType = "application/octlet-stream"
    Response.BinaryWrite( some data I got elsewhere )
    Response.Flush()
    Response.Close()

    Saving, Opening works fine, but an empty window is remaining.
    If I remove the line ..AddHeader("Content-Disposition", .. then the
    filename is set to the aspx page name, but the empty windows is gone.

    Does anyone know why that happens and how I can close that empty
    window.
    I use ie6 sp2 on xp.

    Thanks

    Martin
     
    , May 3, 2006
    #1
    1. Advertising

  2. Guest

    Hi,

    no answers???
    No one has this problem? Or is there no solution?
    Did I make errors?


    Thanks

    Martin
     
    , May 5, 2006
    #2
    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. ben
    Replies:
    0
    Views:
    1,071
  2. =?Utf-8?B?R1JF?=
    Replies:
    1
    Views:
    3,412
    Craig Deelsnyder
    Aug 20, 2004
  3. Replies:
    0
    Views:
    564
  4. Replies:
    2
    Views:
    396
  5. Bob Jones
    Replies:
    2
    Views:
    515
    Bob Jones
    Nov 13, 2007
Loading...

Share This Page