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.

Removing Uploaded Files

  1. Is there anywhere in Wordpress that you can delete the Gravity Forms uploaded files? Or can this only be done via FTP?

    Thanks!

    Posted 12 years ago on Wednesday May 11, 2011 | Permalink
  2. When you delete an entry it should delete the uploaded files associated with that entry. Otherwise you would have to FTP and browse to wp-content/uploads/gravity_forms and delete the files you want to remove. However, Entry data may still point to those files if you just delete the file itself.

    Posted 12 years ago on Wednesday May 11, 2011 | Permalink
  3. Carl,

    Unfortunately when I delete the entry is leaves the file and does not delete it. I was hoping my client could have resumes uploaded on their site and they could get them via email, and manage everything through the wordpress dashboard.

    Thanks,
    Adam D

    Posted 12 years ago on Wednesday May 11, 2011 | Permalink
  4. Carl, deleting the entry does not delete the associated file uploads. Is there a resolution to this? My clients can not FTP and try to find files - that would be a mess! Please advise...

    Posted 12 years ago on Monday July 18, 2011 | Permalink
  5. Currently deleting the entry does not delete the files associated with that entry.

    We will be adding this most likely in the 1.6 release. We've been holding back on doing so until we implement Trash functionality for Entries. Because once you delete them, they are gone. So we don't want to implement something like this until we have Trash functionality for situations where you delete an entry by accident.

    If you want to delete the files, you can edit the entry and then click the Update button and delete the individual files.

    Posted 12 years ago on Monday July 18, 2011 | Permalink
  6. Came looking for exactly this, I too am wanting resume (aka. CV's) submission via. Gravity Forms...spotted that deleting entries doesn't delete associated files.

    Oh well, at least I know it's coming in v1.6!

    PS. @Carl, is there an ETA on v1.6?

    Posted 12 years ago on Tuesday September 6, 2011 | Permalink
  7. Carlos
    Member

    We have upgraded to 1.6, but it does not look like this has been implemented -- can you please provide an update? This is a big deal, as we now have files sitting on the FTP without any associated entries, so they may stay there forever!

    Posted 12 years ago on Monday November 28, 2011 | Permalink
  8. Gravity Forms should be deleting entry related uploads when you delete an entry now.

    It was a change made in Gravity Forms v1.6. It should occur both when you delete a file by editing an individual entry, and when you delete an entry permanently via the Trash.

    I just verified this is indeed working as intended on my local test install. I have documented this via screenshots below.

    Here is my entry detail showing the 2 files I uploaded:
    http://dl.dropbox.com/u/185347/Slingshot/Pictures/Screen%20Shot%202011-11-28%20at%204.02.44%20PM.png

    Here are the files on my development server:
    http://dl.dropbox.com/u/185347/Slingshot/Pictures/Screen%20Shot%202011-11-28%20at%204.03.34%20PM.png

    Here is my entry detail after deleting 1 file:
    http://dl.dropbox.com/u/185347/Slingshot/Pictures/Screen%20Shot%202011-11-28%20at%204.03.53%20PM.png

    Here are the files on my development server after deleting 1 file:
    http://dl.dropbox.com/u/185347/Slingshot/Pictures/Screen%20Shot%202011-11-28%20at%204.04.15%20PM.png

    Here are the files on my development server after moving the Entry to the Trash and then deleting it permanently from the Trash:
    http://dl.dropbox.com/u/185347/Slingshot/Pictures/Screen%20Shot%202011-11-28%20at%204.04.56%20PM.png

    Please note when you move an Entry to the Trash it does not delete the files associated with the Entry. It only deletes the files when you go to the Trash and delete the entry permanently. This is to prevent accidental deletion of files that you didn't intend to actually delete.

    If this is not functioning properly then something isn't correct. The first thing I would check is make sure you have file permissions set so that the permissions on the wp-content/uploads/gravity_forms folder and ALL of it's sub-folders are set so that Gravity Forms which executes as PHP can delete existing files. It could be a file permission issue.

    Posted 12 years ago on Monday November 28, 2011 | Permalink
  9. Carlos
    Member

    Thank you for the thorough testing.

    However, I cannot get it to work on our system. I will have our developer spend some time debugging it, but one obvious difference I see is that the directory names for our uploads are not just showing the ID of the form -- they appear to have a hash tag inserted into them.

    For example, if I make a new form, give it a file upload field, and upload a file to it, it's directory on the server is "9-18049550151d08054d552dd9bf6e2eda", instead of simply "9".

    No manner of the deleting uploads (edit the forming entry, deleting the form/emptying the trash) work.

    I am not sure permissions are the problem, as the normal WordPress media gallery works just fine with our existing permissions -- we can add/remove properly. Unless you're bypassing that system...?

    FYI -- we are on a WordPress MultiSite install.

    Posted 12 years ago on Monday November 28, 2011 | Permalink
  10. What version of Gravity Forms are you running? If you see "9" instead of "9-XXXXX" then it doesn't sound like you are running Gravity Forms v1.6+ OR it sounds like you are viewing entries created prior to Gravity Forms v1.6.

    The name of the directory for uploads was changed in v1.6+ to incorporate a unique value as part of the directory name to make the folder name unique so it cannot be guessed.

    Create a new form, with new upload fields and let me know what the folder name is. Also make sure you are running Gravity Forms v1.6.1+ and not an older version of Gravity Forms. The delete functionality was only introduced in Gravity Forms v1.6+.

    Posted 12 years ago on Monday November 28, 2011 | Permalink
  11. Carlos
    Member

    We are running 1.6.1 in a MultiSite environment -- our new folders contain the hash.

    I noticed in your screenshots that your folder did not, hence why I brought it up.

    Posted 12 years ago on Tuesday November 29, 2011 | Permalink
  12. Carlos
    Member

    So our developer believes that Gravity forms is not doing a proper check for MultiSite installations (which normal WP does) before trying to delete the files (the locations are different).

    He will be hard coding a fix in the plugin for our purposes, but please let us know if you'd be interested in the code, or in releasing a separate fix.

    Posted 12 years ago on Wednesday November 30, 2011 | Permalink
  13. Carlos
    Member

    Our fix is in and files are being removed correctly on our MultiSite install; let us know if you'd like more details and/or if you plan to fix it in the core plugin.

    Thanks,

    Posted 12 years ago on Wednesday November 30, 2011 | Permalink
  14. Yes, any details you can provide will be most helpful so we can compare code and see exactly what is going on in this scenario. You can use http://pastie.org/ to show us the code if that works easiest for you. We are getting ready to release Gravity Forms v1.6.2 so if you can give us more details we should be able to work this fix into the next release.

    Posted 12 years ago on Wednesday November 30, 2011 | Permalink
  15. Is there anyway to set up uploaded files to "auto - delete" after a specific period of time or when a certain size limit is reached.

    I dont want files "piling up" and dont really want to go in and delete them by hand.

    Thanks

    Posted 12 years ago on Sunday March 18, 2012 | Permalink
  16. @AndyDods +1000 for a feature like that.

    My client's site is on a server with limited disk space and he is receiving 50+ emails with heavy attachments each week. The server disk gets full quickly. Now I or the client need to delete entries or files manually... An automated setting could be a real timesaver!

    Thanks!

    Posted 10 years ago on Thursday May 30, 2013 | Permalink
  17. David Peralty

    Thanks for letting us know. All my best!

    Posted 10 years ago on Thursday May 30, 2013 | Permalink