Hi,
The correct code should look like this:
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;
}
Just keep in mind that the hook ‘frm_upload_folder’ is used to organise files inside ‘/wp-content/uploads/formidable/’, not to allow you to upload files outside of that directory.
So using the path and form ID you used, the directory structure would look like this in the end: ‘/wp-content/uploads/formidable/12/wp-content/uploads/product_images/’
You can see more information and examples within our documentation:
https://formidableforms.com/knowledgebase/frm_upload_folder/
Please let us know if you have any additional questions.