RE: [PHP] Image Storage

2004-03-24 Thread Michael G
Best to use the filesystem for images - 

Michael 

-Original Message-
From: David T-G [mailto:[EMAIL PROTECTED] 
Sent: 23 March 2004 22:04
To: PHP General list
Cc: Matt Palermo
Subject: Re: [PHP] Image Storage

Matt --

...and then Matt Palermo said...
%
% I am creating a system to allow users to upload images to the site.  Would
% it be better to store the images in a MySQL table, or having it save the %
images to a directory on the server?  Anyone have any suggestions on this?
% Pros? Cons?

This has been debated to death; check the archives.  Although there are
passionate arguments for both approaches, I *think* that the consensus for
general applications where you don't have a specific reason to put them in
the DB is to go with the filesystem -- but, then, I'm also a subscriber of
that camp :-)


%
% Thanks,
%
% Matt
% http://sweetphp.com/


HTH  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

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



Re: [PHP] Image Storage

2004-03-23 Thread James Coder
Michal Migurski wrote:
I am creating a system to allow users to upload images to the site.
Would it be better to store the images in a MySQL table, or having it
save the images to a directory on the server?  Anyone have any
suggestions on this? Pros? Cons?

MySQL themselves advise you use the filesystem for images - faster.

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


Re: [PHP] Image Storage

2004-03-23 Thread David T-G
Matt --

...and then Matt Palermo said...
% 
% I am creating a system to allow users to upload images to the site.  Would
% it be better to store the images in a MySQL table, or having it save the
% images to a directory on the server?  Anyone have any suggestions on this?
% Pros? Cons?

This has been debated to death; check the archives.  Although there are
passionate arguments for both approaches, I *think* that the consensus
for general applications where you don't have a specific reason to put
them in the DB is to go with the filesystem -- but, then, I'm also a
subscriber of that camp :-)


% 
% Thanks,
% 
% Matt
% http://sweetphp.com/


HTH  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] Image Storage

2004-03-22 Thread Michal Migurski
I am creating a system to allow users to upload images to the site.
Would it be better to store the images in a MySQL table, or having it
save the images to a directory on the server?  Anyone have any
suggestions on this? Pros? Cons?

Depends on the details of your situation - I've generally preferred to
store image in the filesystem. A few hosts I've used have administrative
limits on the size of a BLOB field, so storing images in the filesystem
was mandatory.

If those images are stored within the docroot, you can also just refer to
them by URI and let Apache handle all the appropriate headers and such, or
if you're strapped for CPU you can even use a completely different
webserver (thttpd, apache without PHP, etc.) to serve them.

If they're stored in the database or outside the docroot, you can control
access to them more easily. Keeping them in the database also means that
you don't have to worry about various filesystem considerations, like
keeping a world-writeable directory or potential undesired access from
others users in a shared hosting environment.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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