473,387 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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


Nov 17 '05 #1
2 1205
you are a star! thanks for the rapid response Steve!
"Steve C. Orr, MCSD" <St***@Orr.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
You need to add this line of code:
Response.AddHeader("Content-Disposition","attachment;filename=" &
strFileName)

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
Developer for Hire
"James Cooke" <ja********************@yahoo.com> wrote in message
news:O3**************@TK2MSFTNGP10.phx.gbl...
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


Nov 17 '05 #2
Steve is a big STAR I vote for him

"James Cooke" <ja********************@yahoo.com> wrote in message
news:eV**************@tk2msftngp13.phx.gbl...
you are a star! thanks for the rapid response Steve!
"Steve C. Orr, MCSD" <St***@Orr.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
You need to add this line of code:
Response.AddHeader("Content-Disposition","attachment;filename=" &
strFileName)

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
Developer for Hire
"James Cooke" <ja********************@yahoo.com> wrote in message
news:O3**************@TK2MSFTNGP10.phx.gbl...
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



Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: kid4rilla | last post by:
I can successfully write the binary data to an image data type, and successfully retrieve it, but when I attempt to play the file in media player after retrieving it, I get the file type isn't...
7
by: Ludo | last post by:
Hi, I'm working on an open source project and I have a problem with a binary file. When I read the binary file with the program downloaded from sourceforge, I have no problem. However, I'm unable...
4
by: Dmitry Teslenko | last post by:
Hello! I have some postgresql database that stores binary data (windows/linux executables). Field type I use for this is bytea. Also I have php script that allows users download these binaries via...
5
by: Filipe Teixeira | last post by:
Hi. I have to open a binary file from an old computer and recover the information stored (or at least try to). I use: f=open('file.bin','rb') a=f.read() f.close() a in now a string full...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.