Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > HELP: writing a file to response buffer --> IE shows wrong filename

Thread Tools

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

Posts: n/a

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

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 !


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Is it possible to let a virtual file created by cStringIO havea filename so that functions can read it by its filename? Steven Howe Python 0 01-14-2011 10:32 PM
The filename set in the response.setHeader("Content-Disposition", "attachment; filename=test.csv") is being ignored! Ed Java 10 07-13-2010 12:43 PM
File.fnmatch? doesn't distinguish between .filename and ./filename ? Stefano Crocco Ruby 0 11-14-2008 10:48 AM
Session var in page_load shows old value, buttonclick shows new . Whats wrong gce ASP .Net 0 05-07-2005 06:50 AM
can i modify the content in the buffer of response(not response.buffer prep) xingye ASP General 9 04-19-2004 03:49 AM