FIX: File Extension Parsing for URLs with Query Strings

ID: Q221805


The information in this article applies to:
  • Microsoft Internet Explorer (Programming) versions 4.0, 4.01, 4.01 SP1, 4.01 SP2, 5.0


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 this to be a problem in the Microsoft products 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.

© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Jason Strayer, Microsoft Corporation

Additional query words:

Keywords : kbIE400bug kbIE401bug kbInfoDelivery kbIE401sp1bug kbGrpInet
Version : WINDOWS:4.0,4.01,4.01 SP1,4.01 SP2,5.0
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: November 20, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.