FIX: File Extension Parsing for URLs with Query Strings (221805)



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 4.0
  • Microsoft Internet Explorer (Programming) 4.01
  • Microsoft Internet Explorer (Programming) 4.01 SP1
  • Microsoft Internet Explorer (Programming) 4.01 SP2

This article was previously published under Q221805

SYMPTOMS

Internet Explorer appears to be incorrectly parsing the file extension of URLs in the following form:
http://server/resource.ext?querystring
				
Several symptoms manifest as a result, including the following:
  • Cache file name in Temporary Internet Files folder is missing an extension or lists the extension as '.'
  • The "File Download" dialog box lists no extension for the file
  • Plugins become incorrectly registered to the '.' extension and URLs of this form begin to fail when serving plugin data

CAUSE

Internet Explorer is incorrectly determining the file extension for cache files from URLs that use a query string. Because the cache file name is used by many other parts of Internet Explorer during the download, this error can cause problems in many other unexpected areas of the product.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
This problem was corrected in Internet Explorer 5 and Internet Explorer 4.0 Service Pack 2.

MORE INFORMATION

URLs in this form are particularly troublesome. The presence of a query string usually indicates that the resource should be run on the server and thus the file extension is not an accurate reflection of the data in the server's response.

Versions of Internet Explorer preceding Internet Explorer 4.01 Service Pack 2 ignore the extension of the resource preceding the query string in the URL. Servers can trick the URL parsing algorithm by adding an extension onto the end of the query string as a query string parameter. For example:
http://www.microsoft.com/file.xyz?param1=value1&filename=file.xyz
				
The extension determined for this URL would be ".xyz".

Internet Explorer 4 Service Pack 2 and higher now detects the extension from before the query string. However, if the extension before the query string is ".exe" or ".dll," Internet Explorer will ignore the ".exe" or ".dll" extension and look for an extension in the query string itself as shown above.


Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug kbChannels kbcode kbDownload KB221805