Thank you @Rob LeVine I found this code in the link you shared, adapted and added it to the functions.php file using a code plugin. It does allow for files to be attached to email, but does not appear to keep the file in WP.
add_action('frm_after_create_entry', 'after_entry_created', 50, 2); //use 50 to make sure this is done very last function after_entry_created($entry_id, $form_id){ if($form_id == 5){ //change 5 to the ID of your form $field_id = 25; //change 25 to the ID of the upload field if(isset($_POST['item_meta'][$field_id])){ if(is_array($_POST['item_meta'][$field_id])){ foreach ($_POST['item_meta'][$field_id] as $p){ if(is_numeric($p)) wp_delete_attachment($p, true); } }else if(is_numeric($_POST['item_meta'][$field_id])){ wp_delete_attachment( $_POST['item_meta'][$field_id], true ); } } } }
Did you verify the file is gone by looking in the wp-content/uploads/formidable/ folder?
Please login or Register to submit your answer