Upload file: To Database or Local Folder?

Codes here !

Moderators: macek, egami, gesf

User avatar
New php-forum User
New php-forum User
Posts: 40
Joined: Thu Jan 23, 2003 5:15 pm
Location: Malaysia

Upload file: To Database or Local Folder?

Postby wmdrumaizi » Tue Jun 03, 2003 11:48 pm

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]

User avatar
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby Redcircle » Wed Jun 04, 2003 2:34 am

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.

Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 2 guests