开发者

Displaying image on page from binary data

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜