I am looking for a control to display binary data as MemoryStream.
The binary source are converted from GIF, JPG, TIF, HTML image file and stored in a SQL table.
Please help.
If you'd like to retrieve the binary image from your database, and display it in your web page, you can create and use a generic http handler to fetch the binary data of the image file from the database and returned the image data through the response.
This article explained with example, how to use
generic http handler to display binary images from database, please refer to it.
With Regards,
Fei Han
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
47 Points
1656 Posts
Looking for a control to display binary data as MemoryStream
Oct 18, 2018 11:36 AM|aspfun|LINK
I am looking for a control to display binary data as MemoryStream.
The binary source are converted from GIF, JPG, TIF, HTML image file and stored in a SQL table.
Please help.
All-Star
48280 Points
17982 Posts
Re: Looking for a control to display binary data as MemoryStream
Oct 18, 2018 04:43 PM|PatriceSc|LINK
Hi,
You could use the img tag or the https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.image.imageurl?view=netframework-4.7.2 as usual. The two options are to give the location of an image handler to which you pass the image id. This handler then retrieve image data from the db and sent it back to the browser. You should really have tons of sample about how to do that. For example : https://www.developerfusion.com/code/5223/using-ashx-files-to-retrieve-db-images/
Another option is to use a https://en.wikipedia.org/wiki/Data_URI_scheme (likely best for small images that won't need caching).
All-Star
40535 Points
6233 Posts
Microsoft
Re: Looking for a control to display binary data as MemoryStream
Oct 22, 2018 06:31 AM|Fei Han - MSFT|LINK
Hi aspfun,
If you'd like to retrieve the binary image from your database, and display it in your web page, you can create and use a generic http handler to fetch the binary data of the image file from the database and returned the image data through the response.
This article explained with example, how to use generic http handler to display binary images from database, please refer to it.
With Regards,
Fei Han