• Resolved Sergiy

    (@se8pro)


    Hi, I tried to disable auto-deletion of uploaded files, like this:

    function mtx_remove_action_auto_delete_files() {
    	remove_action( 'template_redirect', 'dnd_cf7_auto_clean_dir', 30);
    }
    add_action('plugins_loaded', 'mtx_remove_action_auto_delete_files', 30, 1);

    and

    add_filter('dnd_cf7_auto_delete_files', 'cf7_adjust_auto_file_deletion');
    function cf7_adjust_auto_file_deletion( $time ){
          $time = 31536000;
          return $time;
    }

    unfortunately this code does not work
    the file is deleted from the temporary folder, and the folder itself is the same
    does not affect and change the date by more (seconds)
    latest WP version 5.7.2
    are there any alternatives?

    after all, with this function, the module is practically useless if files are deleted automatically after a few hours, without the option to disable

    there are analogs of modules (at least 2 more pieces), where this is solved, but I am clarifying whether it is worth using this

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Glen Don Mongaya

    (@glenwpcoder)

    I tried this and it works.

    remove_action('template_redirect','dnd_cf7_auto_clean_dir', 20 );

    Add that code inside your theme functions.php file.

    I will add an option in the admin where you can enable/disable, maybe in the next update.

    Thread Starter Sergiy

    (@se8pro)

    I tried this and it works.
    
    remove_action('template_redirect','dnd_cf7_auto_clean_dir', 20 );
    
    Add that code inside your theme functions.php file.
    
    I will add an option in the admin where you can enable/disable, maybe in the next update.

    Thanks for the quick response.
    I added only this code to the active template, but an hour after submitting the form, I see no file. Unfortunately, it doesn’t work.
    Or maybe you need to add with the previous code?

    Plugin Author Glen Don Mongaya

    (@glenwpcoder)

    That hooks should remove the auto delete features.

    Maybe there other plugin involve, can you send me a screenshot of your current upload directory?

    Plugin Author Glen Don Mongaya

    (@glenwpcoder)

    @se8pro , try to update the latest version I’ve added an option in the admin.

    Under Contact -> Drag & Drop Upload -> Auto Delete Files.

    Thread Starter Sergiy

    (@se8pro)

    @se8pro , try to update the latest version I’ve added an option in the admin.

    Under Contact -> Drag & Drop Upload -> Auto Delete Files.

    Thanks for solving the issue, and a quick solution.
    I updated the module and checked, now everything works with this option ??

    hello,
    We have a problem with uploads files, we can’t find them in our host.

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