• Resolved ramada78

    (@ramada78)


    Hello,
    I wanted to ask whether there is a way to rename uploaded files via form using a value from another field, such as “Full Name” field.
    Maybe I should use a hook or something? please help

Viewing 1 replies (of 1 total)
  • Plugin Support wayes001

    (@wayes001)

    Currently, there is no default feature to change the file name directly via the form. However, you can achieve this using a hook. Here’s an example of how you can use the bitform_validation_success hook to change the file name:

    add_action('bitform_validation_success', 'fileNameChange', 10, 3);
    function fileNameChange($formID) {
        if($formID == 47){ 
            // dynamic field value
            $name = $_POST['b47-2'];
    
            // chnaging file name
            $_FILES['b47-5']['name'] = $name. ".jpg";
        }
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Rename Attached files’ is closed to new replies.