Description
The wpforms_upload_root
filter is used to define the directory on the server where files uploaded through WPForms are stored.
Parameters
- $wpforms_upload_root
- (string) URL used for the default path of storing files uploaded through WPForms.
Source
wpforms/includes/functions/filesystem-media.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 $wpforms_upload_root root path of where file uploads will be stored. * @return string */ function wpf_dev_upload_root( $wpforms_upload_root ) { //Define the path for your file uploads here $wpforms_upload_root = '/home/mysitedomain/public_html/custom-dir'; return $wpforms_upload_root; } 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.
Related
Article Reference: How to Define a Specific Directory For File Uploads