Save BLOB to disk as Image C#

Posted by TGuimond on Stack Overflow See other posts from Stack Overflow or by TGuimond
Published on 2010-04-29T17:24:06Z Indexed on 2010/04/29 17:27 UTC
Read the original article Hit count: 259

Filed under:
|
|
|
|

Hello,

I am developing a web application that calls web services developed by a third party to send/receive data from a clients database. I am building the application using ASP.NET 3.5 C#.

The way that they are providing me images is in BLOB format. I call their method and what I get back is a DataSet with 2 fields "logo_name" and "logo" which is the BLOB field. What I want to do is: Save the image locally on the disk (to minimize calls to their database in the future).

I have been playing around with a couple of different ways of doing this but cannot seem to get the image to save correctly. I have been able to create a file in a folder with the correct name but if I try to view the image it does not work.

I was hoping someone could give me some sample code to show me how to save a BLOB field to the local disk?

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about blob