retrieve binary data from database and display in browser

G

Guest

Hi

I am using a SQL Server 2005 varbinary(max) to store word documents in the
database. I can retrive the data out into a MemoryStream object ok but I want
to be able to use this to display the file in a web browser from an asp.net
page. I found quite a lot of articles like this
http://support.microsoft.com/kb/306654 that tell you do do it from a file on
a hard disk but not directly from a stream object, any ideas. I would rather
not have to create a file on the hard disk first

Thanks
 
G

Guest

Manged to figure this one out, used the WriteTo method of the MemoryStream to
write to the Response.OutputStream
 
G

Guest

Well if you have got it into a byte array or a MemoryStream, you have the
Word Document. However, you still need to use the Word Document object model
to receive this Word Doc and render it as an actual Word document. You could
try setting the Response.ContentType property to the MIME type for Word, and
then BinaryWrite the bytes to the Response Output stream.
Peter
 

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,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top