RE: can i display an image _directly_ from postgres db storage?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Philip,

Typically, it's infinitely more performance-friendly to simply store your
files on the hard disk and use the database to refer to that location.

For instance, assume your root web dir is /www. Inside there you have an
/images directory. 

If you religiously put all files inside of /images you can store the file
name inside the DB and simply have your code output the proper HTML. Or, if
you have to actually do image processing, you can have your code query the
DB and then read the file into an image handler for GD or whatever you're
using to do the processing.

Either way, it's usually encouraged not to store BLOBs whenever possible due
to the performance hit that's usually associated with that.

-M



-----Original Message-----
From: P. George [mailto:invest@xxxxxxxx] 
Sent: Monday, November 01, 2004 10:36 PM
To: php-db@xxxxxxxxxxxxx
Subject:  can i display an image _directly_ from postgres db
storage?

i know that postgres has a raw binary datatype called bytea for storing 
pictures and whatnot, but i'm having trouble finding an example of 
displaying an image on a web page with php that is pulled directly from 
the database?

is this possible?

if so, how?

thanks.

- philip

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux