![]() |
Photo gallery best method to store?
I was planning on a working on a small project of a photo gallery. But I'm wondering what the best method to storing the pictures would be?
A) Upload them to a uploads folder - I don't know how customize you can be with this form B) Store them in a database - lets me add things like title/comment/info of pic and I can show as an array. Is there a better way or different method? Thanks |
I've never been a fan of storing BLOB data in a database for the reason that the database can become HUGE. I would say store them in a folder, and then keep a database to track them. Link them up via their names. That is my preferred way because it keeps the images external to the database, but still ties the database to the images.
|
How you want to do it is up to you, each had their ups and downs.
Doing it out of a MySQL database would be the most secure way because you must have the proper credentials to get it one way or another. This is probably not required for a simple image gallery. MySQL can would be able to do this fairly efficiently if the files were under a few kb each (and under a few million rows) on a capable server (shared servers are not capable). I prefer not to store files in a BLOB on the database since it is always slower than the filesystem (hence the name FILEsystem). Working with them in folders is less secure, but faster and easier to work with, that is what I recommend for this type of things. If you want private images, store them below the webroot and have PHP display them for you. |
thanks for the feed back from both of you :)
|
| All times are GMT. The time now is 02:38 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0