• Resolved yk9s88z8

    (@yk9s88z8)


    Hello,

    We’ve integrated your drag-and-drop field into our form, but we’re encountering an issue. Due to our firewall settings, access to wp-admin is blocked, and it appears that the file upload feature makes a request to wp-admin/admin-ajax.php, resulting in a 403 error.

    For security reasons, we cannot add wp-admin to the whitelist. Is there an alternative solution you could suggest?

    Thank you for your assistance!

    • This topic was modified 4 months, 1 week ago by yk9s88z8.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Glen Don Mongaya

    (@glenwpcoder)

    Hi @yk9s88z8 ,

    Thanks for reaching out.

    Can you try and paste the code below into your theme{child}/functions.php?

     add_filter('dnd_cf7_ajax_url', function(){
    return trailingslashit( site_url() ) . '?ajax-dnd-upload=true';
    });

    add_action( 'init', function() {
    if ( isset( $_GET['ajax-dnd-upload'] ) && 'true' === $_GET['ajax-dnd-upload'] ) {
    if ( ! empty( $_REQUEST['action'] ) && is_scalar( $_REQUEST['action'] ) ) {
    if ( has_action( 'wp_ajax_' . $_REQUEST['action'] ) ) {
    do_action( 'wp_ajax_' . $_REQUEST['action'] );
    }
    }
    die('0');
    }
    });

    Please let me know.

    Thread Starter yk9s88z8

    (@yk9s88z8)

    Thank you it worked ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.