Jump to content

uploading images to a filesystem vs. a database


seniramsu

Recommended Posts

I've heard some debate about which method of uploading images to a server is more efficient/proper.

 

I'm sure both methods have their criteria for use, but I'm not sure which method to use for my project. Here's what I'm trying to do:

 

Enable my client to upload images into the server through an Admin section of the site, with use of html forms, using PHP (currently I'm using a database to hold the images). Then the pictures will show up on the site's front-end, where the user will be able to browse my client's photo galleries. The picture album in the Admin section is similar in functionality to something like Facebook's photos.

 

Right now I'm in the beginning stages of getting this client-manageable photo gallery coded, and would like to know now, early on, which method I should use to prevent a huge headache in the future and a ton of extra work trying to change all my code.

 

thanks!  8)

filesystem+database..LOL,

save your image to a folder in your server and save the filename/image path to your database for retrieval..

tip:.. you may want to use a unique filename for your images just in case your users upload images with same name.. i mean for example 2 users upload "img.jpg" file <= error, maybe you can use session ids+ timestamp for this,..

hahaha...nice.

 

Well, it may be a little late for me to change it, but what I've got set up currently is a database that stores the images wholly. Setting up the file system would be pretty easy, I just don't want to go through the extra work if I don't have to. What I have now works pretty...well...it does what it's supposed to do. I'm in search of some insight as to whether it's going to be a pain in the ass to manage in the future or if it will take up undue server space?

 

Thanks for the help mang.

 

Having observed numerous threads dealing with the same question, it appears the perponderence of the users favor file sytem for the images and the db for keeping the folder/name.

 

http://stackoverflow.com/questions/527801/php-to-store-images-in-mysql-or-not

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.