Re: [PHP] Advice on uploaded files

2003-01-29 Thread Vladimir Galkov
 Me too. I add tracks to DB only and store images as independent files. My
experiments with storing images in DB shows large memory use wich slow down
other processes (especialy if I need to choose several images from DB).

 But if pictures unnumerous and small (smaler 30-40kb) my advice - insert
them in DB.



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




Re: [PHP] Advice on uploaded files

2003-01-29 Thread Maxim Maletsky
Two problems for filesystem:

1. You cannot store over a tot number of images on some systems. Thus,
storing them in DB will be headechless. Unless, you know that there will
be at most some hundred pics or so.

2. Storing them in filesystem gives more trouble as you need to make
sure it is - writable, permissions won't change, things won't get
corrupted, it's writable by you and but not by other user etc

I'd say that DB is a better way, although altogether it would get it
a little slower, but not by too much. DB will be quite large.


--
Maxim Maletsky
[EMAIL PROTECTED]



Manuel Ochoa [EMAIL PROTECTED] wrote... :

 
 I writting a php program for a small insurance company and they want to receive 
uploaded digital photos.
 
 Should I store the photos in a mysql database or in a directory on the hard drive?
 
 If you have experience with this any advice would be appreciated.


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




Re: [PHP] Advice on uploaded files

2003-01-29 Thread Ernest E Vogelsinger
At 15:54 29.01.2003, Vladimir Galkov spoke out and said:
[snip]
 Me too. I add tracks to DB only and store images as independent files. My
experiments with storing images in DB shows large memory use wich slow down
other processes (especialy if I need to choose several images from DB).

 But if pictures unnumerous and small (smaler 30-40kb) my advice - insert
them in DB.
[snip] 

Humm.
I tend to have everything that's needed for reproduction in the DB - that
means as well images, docs, etc, everything that gets uploaded.

However there's a HUGE performance penalty for this, so I duplicate
binaries to the filesystem. My classes are set up to try to open the file,
and if that doesn't exist they gather it from the DB, cache them to the
expected location, and continue serving.

This method is used throughout our scripts, not only for binaries but also
for all other cached items. It guarantees consistency when moving or
restoring the system, and allows to simply clear all cache files without
disrupting application functionality.

Well, it gets slower for some time while rebuilding the cache...

My 2c :-)


-- 
   O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/


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




Re: [PHP] Advice on uploaded files

2003-01-29 Thread Jason Sheets
You can do either, many people have responded and given their thoughs on
the matter.  I personally avoid storing images in a database, the
filesystem is better equipped IMO to handle files.  On top of the
overhead of storing the image in your database you will be creating
additional database traffic, every image loaded is at least one more
database query on the website.

Jason
On Tue, 2003-01-28 at 17:16, Manuel Ochoa wrote:
 
 I writting a php program for a small insurance company and they want to receive 
uploaded digital photos.
 
 Should I store the photos in a mysql database or in a directory on the hard drive?
 
 If you have experience with this any advice would be appreciated.


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




Re: [PHP] Advice on uploaded files

2003-01-28 Thread Justin French
on 29/01/03 11:16 AM, Manuel Ochoa ([EMAIL PROTECTED]) wrote:

 I writting a php program for a small insurance company and they want to
 receive uploaded digital photos.
 
 Should I store the photos in a mysql database or in a directory on the hard
 drive?
 
 If you have experience with this any advice would be appreciated.


I prefer storing them in the filesystem, and using the MySQL database to
keep track of WHERE they are (link).  There of course are SOME problems with
that... mainly because the two are not joined at the hip... someone could
accidently trash the file, or the MYSQL record, without deleting the other.

Storing the image directly in MySQL has never appealed to me, because you
have to do a little more work to get the image out (sending headers, having
an image script, etc), and mainly because the size of the DB increases
dramatically... which makes backing up more difficult/time consuming.

Each to their own though :)


Justin


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