Index: wordpress-importer.php
===================================================================
--- wordpress-importer.php	(revision 600401)
+++ wordpress-importer.php	(working copy)
@@ -838,7 +838,11 @@
 		wp_update_attachment_metadata( $post_id, wp_generate_attachment_metadata( $post_id, $upload['file'] ) );
 
 		// remap resized image URLs, works by stripping the extension and remapping the URL stub.
-		if ( preg_match( '!^image/!', $info['type'] ) ) {
+		// Note that we don't do this in the case that the original upload didn't
+		// have a valid extension, but we were able to determine one by looking at
+		// the relevant HTTP headers (as denoted by the
+		// 'force_extension_in_replacement' flag)
+		if ( preg_match( '!^image/!', $info['type'] ) && empty($upload['force_extension_in_replacement'])) {
 			$parts = pathinfo( $url );
 			$name = basename( $parts['basename'], ".{$parts['extension']}" ); // PATHINFO_FILENAME in PHP 5.2
 
@@ -859,9 +863,30 @@
 	 * @return array|WP_Error Local file location details on success, WP_Error otherwise
 	 */
 	function fetch_remote_file( $url, $post ) {
+
 		// extract the file name and extension from the url
 		$file_name = basename( $url );
 
+		// Some systems, like moveable-type / typepad, advertise files w/o
+		// extension information attached.	We can get around this limitation
+		// by grabbing information about the file from the webserver
+		$file_type = wp_check_filetype($file_name);
+
+		// If there is a situation where we're adding a file extension
+		// onto an upload that didn't originally have one, we
+		// can tell the remapper to not strip off the extension/
+		$force_extension_in_replacement = false;
+
+		if ( empty( $file_type['ext'] ) ) {
+
+			$retured_file_info = $this->fetch_attachment_info_from_server( $url );
+
+			if ( $retured_file_info ) {
+				$file_name = $retured_file_info['filename'];
+				$force_extension_in_replacement = true;
+			}
+		}
+
 		// get placeholder file in the upload dir with a unique, sanitized filename
 		$upload = wp_upload_bits( $file_name, 0, '', $post['upload_date'] );
 		if ( $upload['error'] )
@@ -907,6 +932,8 @@
 		if ( isset($headers['x-final-location']) && $headers['x-final-location'] != $url )
 			$this->url_remap[$headers['x-final-location']] = $upload['url'];
 
+		if ($force_extension_in_replacement)
+			$upload['force_extension_in_replacement'] = true;
 		return $upload;
 	}
 
@@ -1081,6 +1108,55 @@
 	function cmpr_strlen( $a, $b ) {
 		return strlen($b) - strlen($a);
 	}
+
+	/**
+	 * Attempts to grab information about a file from a URL.  This
+	 * call just requests the header information from the server (the
+	 * body of the resource isn't fetched) so the call is relativly lite.
+	 *
+	 * @param string $url
+	 *   A valid url to request mime info from
+	 *
+	 * @return array|bool
+	 *   If the server didn't return a valid header, false is returned.  Otherwise,
+	 *   an array with the following keys is returned:
+	 *     'ext' (string):  The extension of the file, if avaiable
+	 *     'type' (string): The advertised mime type of the resource, if available
+	 *     'filename' (string):
+	 *                      The suggested name of the file, if available
+	 */
+	function fetch_attachment_info_from_server($url) {
+
+		$results = array(
+			'ext' => '',
+			'type' => '',
+			'filename' => '',
+		);
+
+		$header_info = wp_remote_head( $url );
+
+		if ( is_wp_error( $header_info ) ) {
+			return false;
+		}
+
+		$content_type = wp_remote_retrieve_header( $header_info, 'content-type' );
+		if ( $content_type ) {
+			$results['type'] = trim( $content_type );
+		}
+
+		$display_disposition = wp_remote_retrieve_header( $header_info, 'content-disposition' );
+		$file_name_pattern = '/filename=([^\s]+)/i';
+		$file_name_matches = array();
+		if ( preg_match( $file_name_pattern, $display_disposition, $file_name_matches ) ) {
+			$results['filename'] = trim( $file_name_matches[1] );
+
+			if ( ( $index = strripos( $results['filename'], '.' ) ) !== false ) {
+				$results['ext'] = substr( $results['filename'], $index + 1 );
+			}
+		}
+
+		return $results;
+	}
 }
 
 } // class_exists( 'WP_Importer' )
