diff --git wp-includes/class-http.php wp-includes/class-http.php
index 12e73bb..5b5c2b8 100644
--- wp-includes/class-http.php
+++ wp-includes/class-http.php
@@ -631,7 +631,7 @@ class WP_Http {
 				$args['method'] = 'GET';
 		}
 
-		return wp_remote_request( $redirect_location, $args );	
+		return wp_remote_request( $redirect_location, $args );
 	}
 }
 
@@ -852,6 +852,12 @@ class WP_Http_Fsockopen {
 
 		$arrHeaders = WP_Http::processHeaders( $process['headers'] );
 
+		//Check the file was fully written to disk
+		if ( $r['stream'] && isset( $arrHeaders['headers']['content-length'] ) && (int)$arrHeaders['headers']['content-length'] > $bytes_written ) {
+			unlink( $r['filename'] );
+			return new WP_Error( 'http_request_failed', __( 'Failed to write full file to disk.' ) );
+		}
+
 		$response = array(
 			'headers' => $arrHeaders['headers'],
 			'body' => null, // Not yet processed
@@ -1030,7 +1036,7 @@ class WP_Http_Streams {
 			if ( ! $stream_handle )
 				return new WP_Error( 'http_request_failed', sprintf( __( 'Could not open handle for fopen() to %s' ), $r['filename'] ) );
 
-			stream_copy_to_stream( $handle, $stream_handle, $max_bytes );
+			$bytes_written = stream_copy_to_stream( $handle, $stream_handle, $max_bytes );
 
 			fclose( $stream_handle );
 			$strResponse = '';
@@ -1048,6 +1054,14 @@ class WP_Http_Streams {
 		else
 			$processedHeaders = WP_Http::processHeaders($meta['wrapper_data']);
 
+		// Check the file was fully written to disk
+		if ( $r['stream'] && isset( $processedHeaders['headers']['content-length'] ) ) {
+			if ( (int)$processedHeaders['headers']['content-length'] > $bytes_written && ! ( $bytes_written === 1 && 0 === (int) $processedHeaders['headers']['content-length'] ) ) { // PHP Bug: http://bugs.php.net/bug.php?id=47997 fixed in 5.2.10
+				unlink( $r['filename'] );
+				return new WP_Error( 'http_request_failed', __( 'Failed to write full file to disk.' ) );
+			}
+		}
+
 		$response = array(
 			'headers' => $processedHeaders['headers'],
 			'body' => null,
@@ -1318,8 +1332,14 @@ class WP_Http_Curl {
 
 		curl_close( $handle );
 
-		if ( $r['stream'] )
+		if ( $r['stream'] ) {
 			fclose( $this->stream_handle );
+			// Check the file was fully written to disk
+			if ( isset( $theHeaders['headers']['content-length'] ) && (int) $theHeaders['headers']['content-length'] > filesize( $r['filename'] ) ) {
+				unlink( $r['filename'] );
+				return new WP_Error( 'http_request_failed', __( 'Failed to write full file to disk.' ) );
+			}
+		}
 
 		$response = array(
 			'headers' => $theHeaders['headers'],
