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?
Photo Storage?
Moderator: General Moderators
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
Re: Photo Storage?
I prefer the filesystem route because it just seems weird to store images in a database. That's just my opinion though.
-
bharanidharanit
- Forum Newbie
- Posts: 15
- Joined: Sun Jan 03, 2010 9:13 pm
Re: Photo Storage?
Do u have any idea how social networking websites like, facebook, orkut, twitter are saving the images or photos?Charles256 wrote:I prefer the filesystem route because it just seems weird to store images in a database. That's just my opinion though.
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
Re: Photo Storage?
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.
/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?
I know the exact idea:bharanidharanit wrote:Do u have any idea how social networking websites like, facebook, orkut, twitter are saving the images or photos?Charles256 wrote:I prefer the filesystem route because it just seems weird to store images in a database. That's just my opinion though.
Haystack
Re: Photo Storage?
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
- Alex