Upload file: To Database or Local Folder?



Hi guys, I have several qustions regarding file upload:

1) I'd like to know where should I store my website member picture (.jpg, .jpeg, .gif)- in database table or in a local folder? Which one is better.

2) If I use local folder; what happen to the existing file when another member upload his/her picture with same name?

3) If I use local folder; how do I display member info with his/her picture?

4) If I use database table; what happen to the existing file when the member upload his/her picture once again?

Thanks and regards....[/quote][/code][/list][/list][/url]
I would use the filesystem. not the database to store the images.

putting it into the database will slow things down cause you have to query the database then output it to the screen.

your best method would use a unique name for the image someone uploads. i.e. thier user_id or some other identifier. that way you don't have to worry about someone uploading an image with the same name. If someone changes thier image it will overwrite the existing image. same thing if you decide to use the database.