Article ID: 173308 - Last Review: May 2, 2006 - Revision: 5.1 How To Display Images Stored in a BLOB FieldThis article was previously published under Q173308 SUMMARY Using Active Server Pages (ASP), you can view images stored
in BLOB (Binary Large Object) fields in your Internet browser. This article
provides information on how to display a GIF image stored in the Microsoft SQL
Server sample database table pub_info. MORE INFORMATION Most Internet browsers support the displaying of GIF and
JPEG images. To display an image, the browser requests the image from a Web
server. The server passes the image to the browser as an HTTP transaction with
an HTTP header containing an MIME type of IMAGE/GIF or IMAGE/JPEG. You can
simulate this behavior with Active Server Pages. The following example constructs an HTTP header for an image and then uses the binary information from an image field in SQL Server to provide a GIF to the browser. This technique can also be applied to other types of binary data, not just graphics. The browser needs to know what type of content is being presented. Do this by specifying the proper mime type in the Response.ContentType variable. For example, if you wanted to view a word document, you would set the ContentType = "application/msword". REFERENCES For the latest Knowledge Base artices and other support
information on Visual InterDev and Active Server Pages, see the following page
on the Microsoft Technical Support site:
http://support.microsoft.com/search/default.aspx?qu=vinterdev
(http://support.microsoft.com/search/default.aspx?qu=vinterdev)
| Article Translations
|
Back to the top
