Re: [PHP-DB] Storing images in MySQL table

2003-02-20 Thread sumbry
 The only disadvantage i've had of storing images in DB instead of
 Filesystem, is that when you use a PHP script to output the image to a
 client browser, MSIE doesn't always accept a suggested filename so it
 might try and save it as your-script.php?img=2.

 Other then that, keeping images in DB is a lot easier since you don't
 have to keep your DB in sync with Filesystems ie. Deleted records in DB,
 but images still exist.

A way I've gotten around this, is that when I dump images into a directory
for use by articles in my db, the filename is always name
$articleid.filename (since articles and pics are uploaded to the server
via php, this is easy to enforce).

Thus, when I do kill of articles and what not, I simply remove
$articleid.* from my images directory as well.

I would strongly argue against stuffing images into a database tho.
That's what filesystems are for, and they are way better at it.  The
overhead alone is reason enough to make you decide against it.

--
At no time is freedom of speech more precious than when a man
hits his thumb with a hammer. -- Marshall Lumsden
Sumbry][ [EMAIL PROTECTED]


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




Re: [PHP-DB] Storing images in MySQL table

2003-02-19 Thread Corne' Cornelius
Milan,

The only disadvantage i've had of storing images in DB instead of 
Filesystem, is that when you use a PHP script to output the image to a 
client browser, MSIE doesn't always accept a suggested filename so it 
might try and save it as your-script.php?img=2.

Other then that, keeping images in DB is a lot easier since you don't 
have to keep your DB in sync with Filesystems ie. Deleted records in DB, 
but images still exist.


[EMAIL PROTECTED] wrote:

Hi everybody,
	i want to store some articles and images to them in MySQL 
db. could you just give advice if it is better to store the image in BLOB 
or if to save on server and in db just have it's URL.


			Hi Milan


 





=Disclaimer and Confidentiality===
This message contains information intended for the perusal, and/or use (if so stated), by the stated addressee(s) only. The information is confidential and privileged. If you are not an intended recipient, do not peruse, use, disseminate, distribute, copy or in any manner rely upon  he information contained in this message (directly or indirectly). The sender and/or the entity represented by the sender shall not be held accountable in the event that this prohibition is disregarded. If you receive this message in error, notify the sender immediately by e-mail, fax or telephone representations contained in this message, whether express or implied, are those of the sender only, unless that sender expressly states them to be the views or representations of an entity or person, who shall be named by the sender and who the sender shall state to represent. No liability shall otherwise attach to any other entity or person. ==


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




Re: [PHP-DB] Storing images in MySQL table

2003-02-19 Thread Len Sorensen
On Wed, Feb 19, 2003 at 11:07:28AM +0200, Corne' Cornelius wrote:
 The only disadvantage i've had of storing images in DB instead of 
 Filesystem, is that when you use a PHP script to output the image to a 
 client browser, MSIE doesn't always accept a suggested filename so it 
 might try and save it as your-script.php?img=2.

Perhaps using the syntax 'your-script.php/imagename?otherparams' would
solve that.  It does for the few cell phones I have worked on serving
images to.  At least apache allows that syntax.

 Other then that, keeping images in DB is a lot easier since you don't 
 have to keep your DB in sync with Filesystems ie. Deleted records in DB, 
 but images still exist.

Certainly nice.  Now if only postgres had a nice way to dump/backup
BLOBs. :)

Len Sorensen

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