Discussion Locked

embed graphics in html

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a database with graphics images stored as blobs. I want to be able to send those blobs to a web-browser client for viewing. for security reasons, I cannot put the image files themselves on the web server. Otherwise I could use the html tag.

I don't know enough to adequately find what HTML tags/techniques would do the trick. Need pointers.

Thank you.
Luther

1 reply

by jay eckles

I have gone through a similar project - the images had to be in the database as BLOB fields instead of on the web server as files. The only way to access the photos in the database is to create a server side program - a CGI, a Java Servlet, whatever you're comfortable with. I will say that ASP is possible, but is a collossal pain for this particular task.

The server side program will access the database, select the image, then send a Content-type: image/png header, then send the raw bytes that make up the image. You'll call your server side program like this:

program is the name of the server-side program. Key is a parameter name, and picid would be the value for the key - you'll use that in your program to select the correct picture. The elipsis represents the rest of the tag (alt attribute, for example).

Good luck.

Jay
www.jayeckles.com

This discussion is closed to new replies.