PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

delete entries doesn't delete uploaded files/images

  1. David
    Member

    I added an upload file option and when I delete an entry the URL to the uploaded file (an image in this case) still works (meaning the file wasn't deleted with the entry). There doesn't seem to be any way to delete that file short of FTP. I can see how this could be exploited by spammers uploading porn to my blog and then when I delete the bogus entries the porn stays behind and they can embed links to it in their sites using my bandwidth. Not sure if there is an easy way to have the delete entry function also delete the associated image/file or not.

    Posted 13 years ago on Monday November 29, 2010 | Permalink
  2. Currently deleting the entry does not delete associated files. They would have to be deleted manually. But this is a good point, we will look into how we can better handle this in a future release.

    Posted 13 years ago on Monday November 29, 2010 | Permalink
  3. As long as you have the ability to delete files from your host:

    $tmpfile = "/tmp/someimage.jpg";
    unlink($tmpfile);

    You would add this in a hook while the form is being processed, but before it is updated.

    Posted 13 years ago on Monday November 29, 2010 | Permalink
  4. stardust
    Member

    It's been 2 years. Looks like this hasn't been adressed yet. All those images are cluttering my WP installs.

    Any chance you guys can fix this bug?

    Posted 11 years ago on Thursday December 13, 2012 | Permalink
  5. David Peralty

    Hi stardust, this isn't really a bug and the issue is more complex than just deleting the images when an entry is deleted, as the image could be part of a post created by Gravity Forms, or the image could be part of an image gallery. We have to be careful how we go about adding features like this to retain user control.

    Also, it hasn't been highly requested for us to work on this, and so we've been spending effort elsewhere.

    Posted 11 years ago on Thursday December 13, 2012 | Permalink

This topic has been resolved and has been closed to new replies.