Page 1 of 1

Photo Storage?

Posted: Sun Jan 10, 2010 1:58 pm
by bharanidharanit
Hi,
I am providing users to store their photos in my website. Which is the best one to store and provide security? file system or database?

Re: Photo Storage?

Posted: Sun Jan 10, 2010 2:04 pm
by Charles256
I prefer the filesystem route because it just seems weird to store images in a database. That's just my opinion though.

Re: Photo Storage?

Posted: Sun Jan 10, 2010 2:07 pm
by bharanidharanit
Charles256 wrote:I prefer the filesystem route because it just seems weird to store images in a database. That's just my opinion though.
Do u have any idea how social networking websites like, facebook, orkut, twitter are saving the images or photos?

Re: Photo Storage?

Posted: Sun Jan 10, 2010 2:19 pm
by Charles256
When I was coding a system where users upload stuff I normally do the following structure

/public_html/user_files/user_name/photos/thumb
/public_html/user_files/user_name/photos/full

/public_html/user_files/user_name/video/screen_shot
/public_html/user_files/user_name/video/movie_file

Or something like that. Disable direct access to those folders then use a PHP script to load stuff up from the folders. Hopefully that gives you a direction to start looking in.

Re: Photo Storage?

Posted: Sun Jan 10, 2010 2:25 pm
by timWebUK
bharanidharanit wrote:
Charles256 wrote:I prefer the filesystem route because it just seems weird to store images in a database. That's just my opinion though.
Do u have any idea how social networking websites like, facebook, orkut, twitter are saving the images or photos?
I know the exact idea:

Haystack

Re: Photo Storage?

Posted: Mon Jan 11, 2010 10:07 am
by vanguard
For small-medium use I would recommend saving photos to disk and having a database entry with the full path of the photo as well as any other details stored with it. This is simply because file operations tend to be faster than database operations, and that databases often have lower space quotas on webhosts than quotas for generic disk space.

- Alex