开发者

Displaying image on page from binary data

开发者 https://www.devze.com 2023-03-17 16:32 出处:网络
I store my image file into the database as binary type ? if i 开发者_如何学Pythonwant to get the image from the database and show it into aspx page.

I store my image file into the database as binary type ?

if i 开发者_如何学Pythonwant to get the image from the database and show it into aspx page.

I have two option

1.To build a handler

2.to use data uri scheme (which i prefer)

what option should i prefer to show the image


Handler is the way to go. Data URI would only be good if the images were very small, because the user will need to wait for a big page to download with images embedded rather than get the page super-quick then download images concurrently on different connections/threads.


Personally I prefer the HTTPHandler approach. It means that should you decide later on that you would prefer to store your binary images in some other fashion then you simply have to update the handler accordingly.

There's a good example of the HTTPHandler approach on this link;

http://www.worldofasp.net/tut/images/Displaying_images_in_ASPNET_using_HttpHandlers_92.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消