Social Networking Site - Upload Pictures

#1
[eluser]$ilovephp[/eluser]
I am currently developing a social networking site (like facebook, friendster, etc.,) where in the user can upload multiple photos or images. My question is, is it rightful to store the uploaded pictures to the database or just save it to a folder.

Any idea? or Other options that will cater this problem. Thank you. Your answer is greatly appreciated.

#2
[eluser]Bart v B[/eluser]
please.. no pics into a database Wink
there is a way to store pics in a database with a BLOB.
But its slow.

A better way is to store the filename into a database.

#3
[eluser]$ilovephp[/eluser]
[quote author="Bart v B" date="1271930486"]please.. no pics into a database Wink
there is a way to store pics in a database with a BLOB.
But its slow.

A better way is to store the filename into a database.[/quote]

I appreciate your answer. So, what do you think is the best way to store it? I mean, all the uploaded pictures will be stored into a single folder? Or have one folder for each user?

#4
[eluser]Bart v B[/eluser]
Well.. if there are more then one picture it's a better way to store the pics into a folder that belongs to the user. you can create a folder that corensponse with the user id in your database.
Then you only need to make a folder when the user register on youre website.

If it's just one picture you can make one folder that all pics has.
But i think that's not the meaning what you want.

#5
[eluser]djsc00p[/eluser]
There is a little annoyance that you might run into when you store all files in the same directory (or even all user directories in one directory, which in turn contain user photos).

If the number of photos and/or number of users gets really large then you're going to have tons of files/directories in one directory. What I would do is create some class that organizes these files and directories into a tree of 2 to 3 levels. Then just store the path in database.

I hope that helps.


[quote author="$ilovephp" date="1271930868"][quote author="Bart v B" date="1271930486"]please.. no pics into a database Wink
there is a way to store pics in a database with a BLOB.
But its slow.

A better way is to store the filename into a database.[/quote]

I appreciate your answer. So, what do you think is the best way to store it? I mean, all the uploaded pictures will be stored into a single folder? Or have one folder for each user?[/quote]

#6
[eluser]$ilovephp[/eluser]
ok then, as a conclusion, i should opt to store them in folders and save their path directories to the database rather than storing the photos directly in to the database.

Thanks for your reply guys.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.