Problem with filenames in response.addheader()

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.
 
R

Rob Meade

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top