Index: wp-admin/includes/class-wp-filesystem-direct.php
===================================================================
--- wp-admin/includes/class-wp-filesystem-direct.php	(revision 12371)
+++ wp-admin/includes/class-wp-filesystem-direct.php	(working copy)
@@ -54,13 +54,13 @@
 	/**
 	 * Write a string to a file
 	 *
-	 * @param $file string Path to the file where to write the data.
+	 * @param $file string Remote path to the file where to write the data.
 	 * @param $contents string The data to write.
 	 * @param $mode int (optional) The file permissions as octal number, usually 0644.
-	 * @param $type string (optional) Specifies additional type of access you require to the file.
+	 * @param $type string (optional) Specifies additional type of access you require to the file. Only used by the FTP transports.
 	 * @return bool False upon failure.
 	 */
-	function put_contents($file, $contents, $mode = false, $type = '') {
+	function put_contents($file, $contents, $mode = false, $type = null) {
 		if ( ! ($fp = @fopen($file, 'w' . $type)) )
 			return false;
 		@fwrite($fp, $contents);
Index: wp-admin/includes/class-wp-filesystem-ftpext.php
===================================================================
--- wp-admin/includes/class-wp-filesystem-ftpext.php	(revision 12371)
+++ wp-admin/includes/class-wp-filesystem-ftpext.php	(working copy)
@@ -111,7 +111,8 @@
 	function get_contents_array($file) {
 		return explode("\n", $this->get_contents($file));
 	}
-	function put_contents($file, $contents, $type = '' ) {
+	
+	function put_contents($file, $contents, $mode = false, $type = null ) {
 		if ( empty($type) )
 			$type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII;
 
@@ -125,6 +126,9 @@
 		$ret = @ftp_fput($this->link, $file, $temp, $type);
 
 		fclose($temp);
+
+		$this->chmod($file, $mode);
+
 		return $ret;
 	}
 	function cwd() {
Index: wp-admin/includes/class-wp-filesystem-ftpsockets.php
===================================================================
--- wp-admin/includes/class-wp-filesystem-ftpsockets.php	(revision 12371)
+++ wp-admin/includes/class-wp-filesystem-ftpsockets.php	(working copy)
@@ -115,14 +115,14 @@
 		return explode("\n", $this->get_contents($file) );
 	}
 
-	function put_contents($file, $contents, $type = '' ) {
+	function put_contents($file, $contents, $mode = false, $type = null ) {
 		if ( empty($type) )
 			$type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII;
 
 		$this->ftp->SetType($type);
 
 		$temp = wp_tempnam( $file );
-		if ( ! $temphandle = fopen($temp, 'w+') ) {
+		if ( ! $temphandle = @fopen($temp, 'w+') ) {
 			unlink($temp);
 			return false;
 		}
@@ -134,6 +134,9 @@
 
 		fclose($temphandle);
 		unlink($temp);
+
+		$this->chmod($file, $mode);
+
 		return $ret;
 	}
 
Index: wp-admin/includes/class-wp-filesystem-ssh2.php
===================================================================
--- wp-admin/includes/class-wp-filesystem-ssh2.php	(revision 12371)
+++ wp-admin/includes/class-wp-filesystem-ssh2.php	(working copy)
@@ -160,9 +160,13 @@
 		return file('ssh2.sftp://' . $this->sftp_link . '/' . $file);
 	}
 
-	function put_contents($file, $contents, $type = '' ) {
+	function put_contents($file, $contents, $mode = false, $type = null ) {
 		$file = ltrim($file, '/');
-		return false !== file_put_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file, $contents);
+		$ret = file_put_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file, $contents);
+		
+		$this->chmod($file, $mode);
+		
+		return false !== $ret;
 	}
 
 	function cwd() {
Index: wp-admin/includes/file.php
===================================================================
--- wp-admin/includes/file.php	(revision 12371)
+++ wp-admin/includes/file.php	(working copy)
@@ -546,9 +546,8 @@
 
 		// We've made sure the folders are there, so let's extract the file now:
 		if ( ! $file['folder'] ) {
-			if ( !$fs->put_contents( $to . $file['filename'], $file['content']) )
+			if ( !$fs->put_contents( $to . $file['filename'], $file['content'], FS_CHMOD_FILE) )
 				return new WP_Error('copy_failed', __('Could not copy file'), $to . $file['filename']);
-			$fs->chmod($to . $file['filename'], FS_CHMOD_FILE);
 		}
 	}
 	return true;
