There was a problem uploading the cover image in buddypress, while uploading profile image?

just change /wp-content/plugins/buddypress/bp-core/bp-core-attachments.php file

    }
    // Make sure the file path is safe.
    if ( 0 !== validate_file( $r['image'] ) ) { //this to following one
    if ( 1 === validate_file( $r['image'] ) ) {
                return false;
    }


    $type_subdir = $r['object_dir'] . "https://wordpress.stackexchange.com/" . $r['item_id'] . "https://wordpress.stackexchange.com/" . $r['type'];
    $type_dir    = trailingslashit( $bp_attachments_uploads_dir['basedir'] ) . $type_subdir;

    if ( 0 !== validate_file( $type_dir ) || ! is_dir( $type_dir ) ) { //this to following one
    if ( 1 === validate_file( $type_dir ) || ! is_dir( $type_dir ) ) {
                return $attachment_data;
    }


    $cover_subdir = $object_data['dir'] . "https://wordpress.stackexchange.com/" . $bp_params['item_id'] . '/cover-image';
    $cover_dir    = trailingslashit( $bp_attachments_uploads_dir['basedir'] ) . $cover_subdir;

    if ( 0 !== validate_file( $cover_dir ) || ! is_dir( $cover_dir ) ) { //this to following one
    if ( 1 === validate_file( $cover_dir ) || ! is_dir( $cover_dir ) ) {
    // Upload error response.
    bp_attachments_json_response( false, $is_html4, array(
               'type'    => 'upload_error',