Jump to content

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

Hi

 

I finally manage to solve the problem. As everybody guide me the unlink command actually can delete the picture i was just passing a wrong variable to the command and although that the system seems to work ok the picture was not removed.

 

Thanks for the help ;)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.