This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 3
uploaded files are not deleted when corresponding entry is deleted
Started 10 years ago by karumba | 3 posts |
-
hi,
when i delete entries the associated uploaded files are not deleted on the host. the permissions are set & even if i set directory and all files to 777 it is not working. on the other hand, when i upload files in a form, but don't submit the form, but remove the attached files by clicking on the red "-" in the form itself, the .tmp files are getting deleted.
anything i might have overlooked?
cheers,
janPosted 10 years ago # -
I'm not sure about the point you mention of deleting (removing) the file attachment before the form is submitted - it's not the same thing as what your main question is about. At that point the entry hasn't been saved in the database, nor the file actually uploaded. The "temp" file you speak of is probably a file created on your own computer (of the 'temp internet file" variety) that your browser creates.
There is a setting in MF that causes the entries and uploaded files to not be deleted permanently; it's not a flaw or bug in the application, but by intentional design, as a fail-safe method for recovery of data that is accidentally deleted. Previous versions (prior to 3.x) didn't have this, and there was no way to recover data.
In version 3.x the option to permanently delete entries and associated upload files is turned off, although on the surface it may appear the entries are deleted, they are still in fact stored in the database and just "flagged" as deleted but not actually removed.
As you have observed, your uploaded files are also not deleted if the permanent delete option is off.
I have replicated what you describe, and also tested by turning the permanent delete option ON; I submitted an entry with a file attachment; then deleted the entry. It removed both the DB record and the attached file from the "files" folder under the form's name on my host.
If you want to experiment (suggest making a new form to test this), in the config.php file the setting you need to change is around line 25 (toward the bottom of the file, above the "recaptcha" key settings).
However I would STRONGLY advise you keep that option off as you will have no way to recover accidentally deleted data, unless you regularly do backups of your database e.g. through phpMyAdmin or other database tool and can export / import a SQL dump of your database tables.
Posted 10 years ago # -
thanks! setting "MY_CONF_TRUE_DELETE" to true in the config.php did the trick. the reason i need this is, that my clients upload very large files (up to some GBs) together with the project details. the hardisk of my server would be full in 3-4 weeks. therefore i delete each entry whose files/attachments i already downloaded to my workstation.
Posted 10 years ago #
Reply
You must log in to post.