• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 146
  • Last Modified:

when users wants to delete an image, how to delete the file from your server?

Hi Expert,

I have figured out how to allow users to upload images to an "image" directory on my server, and how to manage these files in mysql.  What I can't figure out is how, if they want to delete an image, how to actually delete it from the server using a perl CGI script.  I *could* just leave it in the image directory, but I don't want to bc it will use unnecessary space.

kesea
0
kesea
Asked:
kesea
1 Solution
 
ishnidCommented:
You can do the following:

unlink("/path/to/images/dir/filename.png");

~ishnid
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now