HELP: writing a file to response buffer --> IE shows wrong filename

Discussion in 'ASP .Net' started by abraham, Jul 5, 2003.

  1. abraham

    abraham Guest

    Hi

    In an .aspx codebehind file I retrieve a file from a database and write it
    to the response buffer, so the browser pops up a 'save file' dialog and the
    user can save the file to disk.

    The relevant part of the code (VB) that does this is listed below:

    Response.Buffer = True
    Response.Clear()
    Response.ContentType = ContentType
    Response.AppendHeader("Content-Disposition", "attachment;
    filename=" + FileName)
    Response.BinaryWrite(b) ' b is a binary array with the contents
    of the file from the db
    Response.End()

    This all works great, but when showing the save file dialog, the browser
    appends [1] to the filename. A file with a zip extension would for example
    get a zip[1] extension, which is pretty annoying.

    Is there any way to enfore the browser the use the exact filename?


    Thanx !

    Mike
     
    abraham, Jul 5, 2003
    #1
    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. gce
    Replies:
    0
    Views:
    776
  2. Ed
    Replies:
    10
    Views:
    46,265
    alok000707
    Jul 13, 2010
  3. xingye
    Replies:
    9
    Views:
    282
    Michael Lu
    Apr 19, 2004
  4. Stefano Crocco
    Replies:
    0
    Views:
    152
    Stefano Crocco
    Nov 14, 2008
  5. Gianni

    IE shows false and Firefox shows true

    Gianni, Jul 10, 2009, in forum: Javascript
    Replies:
    3
    Views:
    472
    Thomas 'PointedEars' Lahn
    Jul 10, 2009
Loading...

Share This Page