Download a file from a database

M

MattB

Can anyone point me to any good articles or examples of delivering a
binary file to the user from a database?
I need to pull a PDF file from a SQL Server image field and send it back
to the browser. I'm not sure if there is already an established "best
way" to do this so I thought I'd ask. I don't want to get too far down
the wrong path. Thanks!

Matt
 
S

Steve C. Orr [MVP, MCSD]

Yes, this article shows you how to download files from a SQL Server
database.
It also shows you how to allow users to upload files into the database.

http://SteveOrr.net/articles/EasyUploads.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


Ken Cox said:
Hi Matt,

Is this what you're after?

HOW TO: Read and Write BLOB Data by Using ADO.NET Through ASP.NET

http://support.microsoft.com/default.aspx?scid=kb;en-us;326502

Ken
Microsoft MVP [ASP.NET]

MattB said:
Can anyone point me to any good articles or examples of delivering a
binary file to the user from a database?
I need to pull a PDF file from a SQL Server image field and send it back
to the browser. I'm not sure if there is already an established "best
way" to do this so I thought I'd ask. I don't want to get too far down
the wrong path. Thanks!

Matt
 
G

Guest

The ASP code was....

Response.ContentType = "application/pdf"
Response.BinaryWrite dr("Fieldname")
Response.end

I presume it would be about the same in .NET..
 
G

Guest

' The ASP code was as follows
Response.ContentType = "application/pdf"
Response.BinaryWrite dr("Fieldname")
Response.end

I presume it will be about the same in .NET..
 

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

Top