# How to show an image stored in a database?

**URL:** <https://forum.kirupa.com/t/how-to-show-an-image-stored-in-a-database/270423>\
**Category:** Uncategorized\
**Created:** [September 9, 2008, 7:45pm UTC](https://forum.kirupa.com/t/how-to-show-an-image-stored-in-a-database/270423 "2008-09-09T19:45:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tslatt](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tslatt](https://forum.kirupa.com/u/tslatt)\
**Post date:** [September 9, 2008, 7:45pm UTC](https://forum.kirupa.com/t/how-to-show-an-image-stored-in-a-database/270423/1 "2008-09-09T19:45:22Z")

</div>

I’m using Actionscript 3 in FlexBuilder 3. I know how to show an image if I have the image’s path: “…/images/whatever.gif”. However, I need to be able to show an image that is stored in a database. Instead of the image being stored on the server and the database containing the path of the image, the actual image itself is in the database.

I have an asp page (showimage.asp) that gets the image from the database and shows it using:  
…  
Response.ContentType = “image/jpeg”  
Response.BinaryWrite Recs(“Site\_Cont\_Image”)  
…

And on another asp page, the way to display the image is:  
\<img src=“showimage.asp?intid=\<%=id%\>”/\>  
where the id is which image in the database to show

But I have no idea how to make this work in Actionscript. I get errors when setting the image path to an asp file instead of to an image file.

Anyone have any ideas?
