Jump to content

[SOLVED] How to delete images??


phpfan

Recommended Posts

Hi php coders!!!

 

I am developing a website that requires to upload, update and delete images. I have successfully managed to upload and update the required pictures but i have some problems when i try to delete the images. Actually i am using the unlink command in order to delete the images but the image is not deleted form the server. Because my client needs to upload images frequently, we cannot afford keeping the old images on the server. How i can actually delete the images and remove them from the server?

 

Thanks for the help in advance  ;)

 

Link to comment
https://forums.phpfreaks.com/topic/63907-solved-how-to-delete-images/
Share on other sites

you need to use unlink() but you'll need to make sure that path is correct... the easiest way to do that is to navigate to the right address for the image and work out what it looks like before trying to copy the structure of the image URL in such a way that it will work for all subsequent dynamic deletions.

 

Hope that helps.

Hi

 

I have tried using the unlink command but the image still remains in the folder, on the server i want to actually delete the image like using the delete option in windows. Is that possible? ???

 

 

i guess unlink or delete can do that if you specify the right file name or path

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.