Problem with filenames in response.addheader()

Discussion in 'ASP .Net' started by =?Utf-8?B?SW5jb3JyZWN0IGZpbGVuYW1lcyBpbiBkb3dubG9h, Oct 28, 2005.

  1. Hi experts,
    I am giving filename as "clearbenefits.infosys.txt" to
    Response.AddHeader as filename parameter. After clicking the download link
    filename on dialogbox is showing as "clearbenefits[1].infosys.txt". How can i
    avoid this. Can any one help me.
    I am using IE6 version, Is this is a explorer problem or coding
    problem.

    Code:

    Dim objReader as new binaryreader(File.Open(filepath,
    FileMode.Open))
    Response.AddHeader ("Content-Disposition", "attachment;filename=" & name)
    Response.ContentType = contentType
    Response.BinaryWrite (objReader.readbytes(filesize))
    objreader.close()

    Thanks for helping.
     
    =?Utf-8?B?SW5jb3JyZWN0IGZpbGVuYW1lcyBpbiBkb3dubG9h, Oct 28, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?SW5jb3JyZWN0IGZpbGVuYW1lcyBpbiBkb3dubG9h

    Rob Meade Guest

    "Incorrect filenames in download link." wrote ...

    > Hi experts,
    > I am giving filename as "clearbenefits.infosys.txt" to
    > Response.AddHeader as filename parameter. After clicking the download link
    > filename on dialogbox is showing as "clearbenefits[1].infosys.txt".


    Normally happens if:

    1 - you have more than 1 fullstop in the file name (ie, the extension cannot
    be determined)
    2 - if you already have a copy of the file in your temporary internet files

    I would suggest item one in this case - rename the file - change the first
    fullstop to a - or something and see if the problem goes away.

    Regards

    Rob
     
    Rob Meade, Oct 28, 2005
    #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. Joseph
    Replies:
    2
    Views:
    5,629
  2. S.Kartikeyan

    Response.AddHeader content-disposition

    S.Kartikeyan, Feb 6, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    3,999
    S.Kartikeyan
    Feb 6, 2004
  3. S.Kartikeyan
    Replies:
    0
    Views:
    2,828
    S.Kartikeyan
    Mar 1, 2004
  4. B.J.
    Replies:
    4
    Views:
    772
    Toby Inkster
    Apr 23, 2005
  5. Andyza
    Replies:
    1
    Views:
    655
    Anthony Jones
    Feb 16, 2007
Loading...

Share This Page