What might cause a POST to wp-admin/async-upload.php to return JSON >and< HTML?

I had the same issue and did not find any information in my debug output.

It worked out, that DOING_AJAX was not defined (I don’t know why).

Changing the beginning of async-upload.php from

if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {
    define( 'DOING_AJAX', true );
}

to

define( 'DOING_AJAX', true );

worked for me. Maybe I will have a deeper look and find the real root cause.

Leave a Comment