• Resolved fbferreirabruno

    (@srbrunoferreira)


    Hello! I use this wpcf7_before_send_mail CF 7 filter and I can’t see the file paths on the snippet below when I use your multi files field. I debug $submission->uploaded_files() and it’s an empty array even though I’ve uploaded some files.

    add_action(‘wpcf7_before_send_mail’, function ($contact_form, &$abort, $submission) {
    $uploaded_files = $submission->uploaded_files();

    I need to do that to be able to move the files to another specific path.

Viewing 1 replies (of 1 total)
  • Plugin Author Glen Don Mongaya

    (@glenwpcoder)

    Hello,

    You can get the uploaded files using below:

    // Adjust the priority to 60 since our plugin is currently using 30.
    add_action('wpcf7_before_send_mail','custom_cf7_before_send_mail', 60, 1);
    function custom_cf7_before_send_mail( $wpcf7 ) {
    $submission = WPCF7_Submission::get_instance();
    $data = $submission->get_posted_data();
    $upload_field = 'upload-file-xxx'; // your upload name here...

    if ( isset( $data[$upload_field] ) ) {
    $files = $data[$upload_field];
    print_r($files);
    }

    }

    Please let me know if this is working on your end.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.