Delete files when entry is deleted?

Hey there,

I use GF Pro since like a year and It work perfectly.

I created a huge process in PHP on a certain form, on submit it create a lead in my CRM & upload files to my office365 cloud.

In my form config, I’ve set up personal data configuration on delete after 31 days. I was thinking it was working since in entry I only see the entry that are less than 31 days old.

But I just found out that all the file are still in my server under my media upload folder/gravity_form/GF ID/year/month

I have around 10 entry per days with 2 uploaded PDF files, so you can imagine that this folder is pretty full.

Those files are uploaded to my cloud so there is no need to have them all in my website upload folder, and it makes for me a security issue since those are “sensible” file from companies.

I would need those file to be deleted when the entry is deleted. How can I achieve that ?

Hope someone can help !

The uploaded files are only deleted when the entry is permanently deleted.

The files remaining suggests the personal data retention policy setting has been set to the trash entries automatically setting. You’ll need to change it to the Delete entries permanently automatically choice.

For the existing entries that have already been trashed, you can empty the trash from the trash view of the entries page. That will permanently delete the entries from the database and their files.

Hey Richard thanks for trying to help !

That the thing that scare me… it’s on permanent delete.

In the trash I have nothing, and in my entry I have nothing older than 31 days, so it basically permanent delete database entry but not uploaded file.

Can this be a permission issue ? But if GF is able to put create and write into a folder, he can also delete right ?

Cause I see all the file in every month number on my server.

Only thing I could see as an issue is that my server is NGINX, and GF build a .htaccess at the root of the gravity_forum folder. But for me if he is able to create file & folder it should be able to delete file.

In gf_system_status page I cant see any issue :

Another possibilities :
I use github and when I push something it moves files, so files last modification change on every push. If your script check the last modification, It will maybe not delete file cause they were moved, and so changed.

Quick update, didnt had the time to dig into this, but Im pretty sure github can cause the issue, since it change the modified date on every push, maybe I should create a cron directly on my side (server) to delete a GF folder from a different month

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.