Problem with filenames in response.addheader()

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
...
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
 
Back
Top