If you're able to read the binary data from the db, then it's a simple
matter of piping/sending the data to the the http client (browser) using
the proper mime type in the "Content-Type" header.

If you want to embed the image in css or html (in the same http request),
then it needs to be base64 encoded using
http://en.wikipedia.org/wiki/Data_URI_scheme

In wheat, the blog engine for howtonode.org, none of the files exist on the
filesystem.  They are all pulled out of a git database and piped to the
browser on the fly.  I added in some smart caching to make it faster, but
the same idea works for any data source.

On Tue, Feb 21, 2012 at 3:55 AM, Angelo Chen <[email protected]>wrote:

> Hi,
>
> I have small jpegs stored in a database (firebird), what is a good
> approach to show those jpegs in a page? Thanks,
>
> Angelo
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to