Display image on web page directly from byte array.
Posted on 2009-05-04
I have successfully managed to upload images into an image field in SQL Server 2005. I can retrieve those images in Byte array format. I want to be able to display that image file as an image in the web page without going to file first. In other words, stream it directly down to the browser and display the image in an <img> tag or <input type="image" or any other tags that takes some kind of src="" parameter. So far, the only thing I have been able to conceive is making an ASPX page that reads the database, modifies the MIME type, and streams down the information that way. Is this the best way to do something like this or is there something better? I am using ASP.NET 3.5 and SQL Server 2005.