Upload Path Modification
-
What am I missing here?
I added the following code to change the upload path/folder for form ID 12. When I test the form by uploading a file, the file name shows up in the entries list and is linked to the right file path, however the file is not actually there, i.e. it’s not there when looking via FTP client and clicking the link to the file returns a 404. It’s like it’s partially working, but writing the file to the location fails. Here’s the code I added to the functions.php file:
add_filter( ‘frm_upload_folder’, ‘frm_custom_upload’, 10, 2 );
function frm_custom_upload( $folder, $atts ) {
if ( $atts[‘form_id’] == 12 ) { // change to your form id
$folder = $folder . ‘../wp-content/uploads/product_images/’;
}
return $folder;
}
- The topic ‘Upload Path Modification’ is closed to new replies.