Specified file failed upload test. wp_upload_handle

The error you are seeing is coming from wp_handle_upload():

// A properly uploaded file will pass this test. There should be no reason to override this one.
if ( $test_upload && ! @ is_uploaded_file( $file['tmp_name'] ) )
    return call_user_func($upload_error_handler, $file, __( 'Specified file failed upload test.' ));

I am not sure about your context, but what you are trying to do seems to not be POST upload and as such fails is_uploaded_file() check.

Leave a Comment