diff --git src/wp-admin/includes/file.php src/wp-admin/includes/file.php
index 98e0f4962c..38ec41fd92 100644
--- src/wp-admin/includes/file.php
+++ src/wp-admin/includes/file.php
@@ -1141,6 +1141,22 @@ function download_url( $url, $timeout = 300, $signature_verification = false ) {
 		return new WP_Error( 'http_404', trim( wp_remote_retrieve_response_message( $response ) ), $data );
 	}
 
+	$content_disposition = wp_remote_retrieve_header( $response, 'Content-Disposition' );
+	if ( ! empty( $content_disposition ) && 1 === preg_match( '/filename="([^ ]+)"/', $content_disposition, $matches ) ) {
+
+		$filename_from_header = wp_tempnam( $matches[1] );
+		if ( ! $filename_from_header ) {
+			return new WP_Error( 'http_no_file', __( 'Could not create temporary file using Content-Disposition header' ) );
+		}
+
+		if ( ! rename( $tmpfname, $filename_from_header ) ) {
+			unlink( $filename_from_header );
+			return new WP_Error( 'http_no_file', __( 'Could not move temporary file' ) );
+		}
+
+		$tmpfname = $filename_from_header;
+	}
+
 	$content_md5 = wp_remote_retrieve_header( $response, 'content-md5' );
 
 	if ( $content_md5 ) {
