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

A

abraham

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
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top