seniramsu Posted May 6, 2010 Share Posted May 6, 2010 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! Link to comment https://forums.phpfreaks.com/topic/200949-uploading-images-to-a-filesystem-vs-a-database/ Share on other sites More sharing options...
iblood Posted May 6, 2010 Share Posted May 6, 2010 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,.. Link to comment https://forums.phpfreaks.com/topic/200949-uploading-images-to-a-filesystem-vs-a-database/#findComment-1054352 Share on other sites More sharing options...
seniramsu Posted May 11, 2010 Author Share Posted May 11, 2010 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. Link to comment https://forums.phpfreaks.com/topic/200949-uploading-images-to-a-filesystem-vs-a-database/#findComment-1056809 Share on other sites More sharing options...
litebearer Posted May 11, 2010 Share Posted May 11, 2010 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 Link to comment https://forums.phpfreaks.com/topic/200949-uploading-images-to-a-filesystem-vs-a-database/#findComment-1056837 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.