• Resolved Nick

    (@alvadesh)


    Hello Team,

    First of all congratulations for giving best form plugin.

    Well, I am testing forminator plugin and I noticed,

    1) If I attach the file to the form and submit it, the Attachment is getting stored in wp-upload folder which is keep consuming more and more space.

    2) It is also adding values in DB which is increasing space of DB.
    3) If you open the Attachment from email it will display complete url of storage such as https://www.example.com/wp-content/uploads/2018-19/08/attachment.pdf which can create Vulnerability.

    Can you please provide the best solution for About Issues?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Imran – WPMU DEV Support

    (@wpmudev-support9)

    Hello @alvadesh,

    Hope you’re doing well!

    The Forminator has an option to disable store submissions in the database. Besides this, you may schedule automate submission deletion along with attachments.

    To apply this globally, please go to Forminator > Setting > Submissions. Each form has the same settings that can overwrite the global settings. Please edit a form and open Settings tab.

    Under Privacy, choose Custom and define the number of days that will keep submissions on your site. And to remove attachments, under Submission Files, choose Delete. Please see this screenshot:
    https://monosnap.com/file/OMO4ftqjLeP9kdiUGYSP0rBluuYWRQ

    For security, you can create a custom folder to keep the attachments. Please upload this file to wp-content/mu-plugins. If the folder doesn’t exist, please feel free to create it.

    The new path will have the following structure form_id/year/month/file. So for example, if upload a test.jpg from a form with ID 10 it would be at wp-content/uploads/10/2018/11/test.jpg.

    You can change the code on line:

    $new_path = '/' . $this->new_dir_id . '/' . date( 'Y' ) . '/' . date( 'm' );

    into:

    $new_path = '/forminator/' . $this->new_dir_id . '/' . date( 'Y' ) . '/' . date( 'm' );

    To upload the attachment file into a custom folder, this will look like;
    /uploads/forminator/10/2018/11/test.jpg

    Let us know if you have any questions.

    Kind regards,
    Nastia

    Thread Starter Nick

    (@alvadesh)

    Thanks Nastia for quick reply.

    Well, as you suggested

    1) Under Privacy, choose Custom and define the number of days that will keep submissions on your site. And to remove attachments, under Submission Files, choose Delete.
    -> My question is if I set only 1 day to keep submission and on second day when the file is deleted, how can we open the attachments when it doesn’t exist on the path?

    2) For security, you can create a custom folder to keep the attachments. Please upload this file to wp-content/mu-plugins. If the folder doesn’t exist, please feel free to create it.
    -> If there are multiple user who have access to a specific email where we are receiving form submission with attachments, everyone will be able to see the path of the file which can still create security breaches.

    What can be the solution for the same.

    I been using Contact form 7 since last 6 years but with the features and bundles of things in forminator, I wanted to switch over the same.

    Here is the example for Contact form 7 Uploaded file management:
    After a user uploads a file through your contact form, Contact Form 7 checks to see if: 1.) Any PHP errors have occurred; 2.) the file type and file size are valid; and then, if the check turns out okay, Contact Form 7 moves the uploaded file to a temporary folder. At this point, Contact Form 7 attaches the file to the mail and sends it. After these procedures, Contact Form 7 then removes the file from the temporary folder.

    I am looking for something like this. Can your team provide any other solutions for Forminator?

    Thanks
    -Nick

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello @alvadesh

    1) I’ve pinged our developers to confirm – or not – the files deletion on server. Will keep you posted here.

    2) In the following link you can find a custom plugin in order to have separate folders per user:
    https://premium.wpmudev.org/forums/topic/forminator-store-uploaded-files-in-separated-folders/#post-3661406
    Please have a test with it and let me know if it covers your needs.

    Thank you,
    Dimitris

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello @alvadesh

    It’s confirmed that Submission Retention will also remove any attachments, as it’s considered normal behavior.
    Not sure if we could exclude this action though, with some custom code. Will need to advise devs once again. Would that work for you? Please advise!

    Take care,
    Dimitris

    Thread Starter Nick

    (@alvadesh)

    I loved the forminator plugin for all the functionalities except the one I mentioned in last thread.

    As I mentioned in previous trail, changing submission folder is not going to help as the core attachment URL will be still naked.

    As you mentioned “submission retention will also remove attachment” in this case the if no attachment is available to the specific URL it will keep showing 404 pages (Unless redirection is set) which means generating log all the time.

    These are the exact reason I am looking the same functionality like contact form 7.

    For ref: https://contactform7.com/file-uploading-and-attachment/

    I am receiving approx 500+ resume from everyday so, reviewing them all in the same day isn’t possible. Storing all those files on the server can surely create load on server. If I set deletion for one day then No attachment will be available next time.

    This is why I am looking for the same solutions as Contact Form7.

    Can you try to get in touch with your dev team and ask the solutions for the same?

    -Nick

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello @alvadesh

    I contacted our developers about it, I’m not sure if something like that will be easily doable at the moment though.

    We’ll keep you posted here as soon as possible. Your patience is highly appreciated! ??

    Thank you,
    Dimitris

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Delete uploaded files after form submission’ is closed to new replies.