When you use behaviors to download information from a file
to an HTML document, and static compression is enabled in Internet Information Services (IIS), the data that is
downloaded to the HTML document does not always appear. Typically, the
document loads as expected on the first try. However, dynamic data may not appear when you try to download it again.
↑ Back to the top
This problem occurs because Internet Explorer always reads compressed data as being cached, even
if the cache-control setting specifies a different value.
↑ Back to the top
If you must have dynamic HTML (DHTML) functionality, turn off compression
on IIS for maximum compatibility.
↑ Back to the top
Microsoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
↑ Back to the top
Steps to Reproduce the Behavior
1. | Create the following in an HTML file. Save it as
Test.htm: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML XMLNS:IE>
<head>
<script language="JavaScript">
function onDownloadDone(s) {
oText.value=s;
}
</script>
</head>
<body>
<IE:DOWNLOAD ID="oDownload" STYLE="behavior:url(#default#download)" />
<p><a href="javascript:oDownload.startDownload('Text.txt', onDownloadDone)">Download Compressed Info to textarea</a>
</p>
<p>
<textarea id="oText" cols="65" rows="10"> </textarea>
</p>
</body>
</html>
|
2. | Insert any text in a text file in Notepad (or any text editor). Save the text file as Text.txt. |
3. | Put both the HTML file and the text file in the same IIS virtual
directory (do not turn on compression). Start Internet Explorer,
and then view the HTML file. Click the button. The text that you saved in
the Text.txt file appears in the text area as expected. |
4. | Turn on compression in IIS, and then reload the HTML file. The
first time that you click the button, the text appears in the text area. When you click the button again (and on
every later try), the text area is blank. |
↑ Back to the top
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
255801
How to Determine if HTTP Compression Is in Use
For more information about developing
Web-based solutions for Microsoft Internet Explorer, visit the following
Microsoft Web sites:
↑ Back to the top