Preferences for handling images

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
PastorHank
Forum Contributor
Posts: 117
Joined: Sat Jun 03, 2006 7:58 am
Location: Texas Hill Country

Preferences for handling images

Post by PastorHank »

I'm getting ready to start retrieving images for use with my web app and I was wondering which method do folks think is more efficient.

Storing the path to an image in the database or storing the image itself in the database and then using the image datafield on a display form.

Thank you
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Path, hands down is more efficient.
Xoligy
Forum Commoner
Posts: 53
Joined: Sun Mar 04, 2007 5:35 am

Post by Xoligy »

Browsers can cache paths, it won't slow down your database and many other advantages. You might want to use the database to store the meta information.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

I like storing user content (images especially) as a file in the filesystem, named with the content's md5 hash. Meta data should be stored in the DB.
PastorHank
Forum Contributor
Posts: 117
Joined: Sat Jun 03, 2006 7:58 am
Location: Texas Hill Country

Post by PastorHank »

Thank you for the input....using the path is working really well
Post Reply