Retrieving a binary file from a database and naminig the downloaded file explicitly

J

James Cooke

I succesfull yam able to download binary data by calling a page called
BinaryData.aspx. BinaryData.aspx gets the binary data from the database,
and displays it as such:

Response.Buffer = True
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = binaryFieldType
Response.BinaryWrite(binaryField)
Response.End()

This then produces a download called

BinaryData.ZIP, or
BinaryData.MDB or
BinaryData.PDF
with the file extension differing depending on what the ContentType is.

My question: I want to be able to change the *root* name of the download to
something else - for example
MyData.ZIP, or
Customers.MDB or
Document1.PDF

How? Am I using the wrong approach in extracting this binary data, and if
so, where do I start looking?
thanks in advance
 

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,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top