hlforr — 2011-08-09T10:33:47-04:00 — #1
I am setting up a CMS where the user can upload images to be used in a slideshow. In the slideshow, when each image is displayed there will be an accompanying text displayed.
The database will store the image name and accompanying text. I want the user to be able to add and delete images. If they delete an image, I want this to be removed from the image folder. If the slideshow is only going to have 5 images, would it be best to store the images on the database or is there an easy way to allow a user to delete the image from an image folder as well as the database?
Apologies for the lengthy question.
starlion — 2011-08-09T10:43:26-04:00 — #2
You should not store the image data in the database. Store a link to the image location, but not the actual image.
When a user wants to delete a picture, SELECT the link to the file, unlink it, and then DELETE the row from the table.
hlforr — 2011-08-09T10:46:26-04:00 — #3
The problem with this is that I could be left with dozens of images in an image folder that are no longer used, thus taking up valuable server space
starlion — 2011-08-09T10:49:22-04:00 — #4
Click the link in my previous post.
hlforr — 2011-08-09T10:52:37-04:00 — #5
Apologies, Yes that is exactly what I need. Many thanks.