Description

The filter is used to define the directory on the server where files uploaded through WPForms are stored.

Parameters

$path
(string) URL used for the default path of storing files uploaded through WPForms.

Source

wpforms/includes/functions.php

More Information

The wpforms_upload_root filter can be used to define where the files uploaded through WPForms are stored.

Example

/**
 * Change the path where file uploads are stored in WPForms.
 *
 * @link    https://wpforms.com/developers/wpforms_upload_root/
 *
 * @param   string  $path  root path of where file uploads will be stored.
 *
 * @return  string
 */

function wpf_dev_upload_root( $path ) {
 
    //Define the path for your file uploads here
    $path = '/home/mysitedomain/public_html/custom-dir';  
        
    return $path;
       
}
add_filter( 'wpforms_upload_root', 'wpf_dev_upload_root', 10, 1 );

This change will change the location of where the files are stored. This will not update the email notification URL.

Snippet Reference: How to Define a Specific Directory For File Uploads