samalapsy's avatar

Updating Image(s) on a listing Website

Hello Everyone,

I have a challenge and don't know what to do in this scenario....I have a listing website that allows users to upload images either single or multiple per post. What should I do If a user wants to update or change an image(s) for a specific post....Should I delete the image(s) from the server and upload the new image(s) or I should leave it there and still upload the new image(s)..

Please if there's a better way to do this i'm very willing and happy to hear.

Thanks in Anticipation

0 likes
6 replies
tekmi's avatar

Maybe having little delete/remove icon at the top right corner of each uploaded picture - once clicked, you can remove the given image via AJAX call?

Or maybe having the checkbox next to each image and the actions bar below the images? Your users could delete multiple images at once.

Every time they try to upload new pictures for given post, I would not delete the old ones. Just always add new ones to this post.

samalapsy's avatar

@tekmi The upload I'm talking about is to change the Image(s) that the post has...Would you think it's taking up the hosting space if I don't delete the previous images..?

tekmi's avatar

@samalapsy you could give your users a way to opt-in for deleting the currently attached images of given post - something like a checkbox with 'Delete/replace previous images' maybe?

If the image is no longer needed and won't be reused anywhere else, I would delete them. It always frees up some hosting space - you could do it either immediately during the next upload or maybe use a scheduler script which cleans up the hanging/unattached files every week or month.

Please or to participate in this conversation.