Re: [PHP-DB] storing images in a table or in a directory
I store alot in databases.. when you deal with filesystem there can be issues with multiple webservers (need replication using something like rsync, etc).. I've used the db/filesystem link method before aswell but typically go with database nowdays.. You do have to query each time to get images out, be sure to look at sending correct cache headers to ensure clients don't keep coming back, or implement a caching system so that the webserver doesn't have to go back to the database for a query each time an image is requested.. On Wed, 20 Aug 2003, hicham kersit wrote: > Hi, > I have to manage a large amount of images uploaded by users on my site. > Using php/mysql I don't know if I should store the images in a directory > within the server or in a dedicated table. > What is the most suited method? > Thanks, best regards. > > > > > > > > -- > 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
Re: [PHP-DB] storing images in a table or in a directory
Hi there, Why not do both? Store the images themselves in a dir, but reference them from a table, so that way you can control them pretty much totally via PHP and MySQL. You could them write a system to create thumbnails from selected items in the database or delete certain images etc . easily, because you'd have the filename/location etc . stored in the DB. That's how I do it anyway, as then you don't have to query each image uploaded everytime, as it queries while you are uploading the image and stores stats such as location, size, type etc ... in the DB. Just a thought :-) Chris > Hi, > I have to manage a large amount of images uploaded by users on my site. > Using php/mysql I don't know if I should store the images in a directory > within the server or in a dedicated table. > What is the most suited method? > Thanks, best regards. > > > > > > > > -- > 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
[PHP-DB] storing images in a table or in a directory
Hi, I have to manage a large amount of images uploaded by users on my site. Using php/mysql I don't know if I should store the images in a directory within the server or in a dedicated table. What is the most suited method? Thanks, best regards. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php