Index: xmlrpc.php
===================================================================
--- xmlrpc.php	(revision 13588)
+++ xmlrpc.php	(working copy)
@@ -2801,12 +2801,21 @@
 			$name = "wpid{$old_file->ID}-{$filename}";
 		}
 
-		$upload = wp_upload_bits($name, $type, $bits);
+		$upload = wp_upload_bits($name, null, $bits);
 		if ( ! empty($upload['error']) ) {
 			$errorString = sprintf(__('Could not write file %1$s (%2$s)'), $name, $upload['error']);
 			logIO('O', '(MW) ' . $errorString);
 			return new IXR_Error(500, $errorString);
 		}
+		
+		//if we don't know the type of the file, try to figure it out...
+		if(!isset($type) || $type == '') {
+			$wp_filetype = wp_check_filetype( $name );
+	
+			if ( $wp_filetype['type'] ) {
+				$type = $wp_filetype['type'];
+			}
+		}
 		// Construct the attachment array
 		// attach to post_id 0
 		$post_id = 0;
