Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mrbleuu

    (@mrbleuu)

    I have worked around this by writing .htaccess URL rewrites to block access to the forminator_temp and wordpress uploads directory, but allowing access to the CSS folder.

    However it would be great if we could upload the form attachments and temp directory to a non-public directory? Is this possible at all?

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @mrbleuu

    I hope you’re well today!

    Please try this code (as mentioned in the discussion that you linked to)

    https://gist.github.com/wpmudev-sls/46d776223d9d54c732fd409b2e78c8a9

    but replace this part

    // For non Ajax submit.
    			add_action( 'forminator_custom_form_before_handle_submit', array( $this, 'trigger_set_upload_dir' ) );
    			add_action( 'forminator_custom_form_after_handle_submit', array( $this, 'restore_upload_dir' ) );
    
    			// For Ajax submit.
    			add_action( 'forminator_custom_form_before_save_entry', array( $this, 'trigger_set_upload_dir' ) );
    			add_action( 'forminator_custom_form_after_save_entry', array( $this, 'restore_upload_dir' ) );

    with this

    // For non Ajax submit.
    			add_action( 'forminator_form_before_handle_submit', array( $this, 'trigger_set_upload_dir' ) );
    			add_action( 'forminator_form_after_handle_submit', array( $this, 'restore_upload_dir' ) );
    
    			// For Ajax submit.
    			add_action( 'forminator_form_before_save_entry', array( $this, 'trigger_set_upload_dir' ) );
    			add_action( 'forminator_form_after_save_entry', array( $this, 'restore_upload_dir' ) );

    This is because since this code was created, related action hooks were updated so they need to be updated in this code as well.

    I’ve just tested it on my own test site and it worked fine with this adjustment.

    Best regards,
    Adam

    Thread Starter mrbleuu

    (@mrbleuu)

    Working great again! Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change upload directory’ is closed to new replies.