RE: [PHP-DB] can i display an image _directly_ from postgres db storage?
| From: | Mike | Date: | Tue, 02 Nov 2004 03:43:03 +0000 |
| Subject: | RE: [PHP-DB] can i display an image _directly_ from postgres db storage? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-37116@lists.php.net to get a copy of this message | ||
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@juun.com]
Sent: Monday, November 01, 2004 10:36 PM
To: php-db@lists.php.net
Subject: [PHP-DB] 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