FIX: The FileDownload event does not always fire (831306)



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 6 (SP1)

Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows registry

SYMPTOMS

The DWebBrowserEvents2::FileDownload event may fire when a file is downloaded. However, you may experience the following problems with this event when you stream a file from the Web server:
  • When you move to a frameset page in an application that hosts the WebBrowser control and handles the FileDownload event, the handler is not called. This behavior occurs if the FileDownload event occurs in one of the frames on the frameset page that streams the file. In this case, the FileDownload event is not propagated to the main window.
  • When you move to a non-frameset page that streams a file, in an application that hosts the WebBrowser control and handles the FileDownload event, the event is raised only when a user clicks Open or Cancel in the File Download dialog box. The FileDownload event does not fire when the user clicks Save.

RESOLUTION

Hotfix information

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Internet Explorer 6 service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

File information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time   Version        Size       File name
   ---------------------------------------------------------
   04-Nov-2003  21:36  6.0.2800.1288  1,339,392  Shdocvw.dll
				

WORKAROUND

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

The FileDownload event is raised only if the following registry entry exists:

FEATURE_SAVEAS_FIREDOWNLOAD_EVENT_KB831306

To work around this problem, follow these steps:
  1. Start Registry Editor.
  2. Locate and then click one of the following registry subkeys:
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl
    • HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl 2
  3. On the Edit menu, point to New, and then click Key.
  4. Type FEATURE_SAVEAS_FIREDOWNLOAD_EVENT_KB831306 3.
  5. On the Edit menu, point to New, and then click DWORD Value.
  6. Type iexplore.exe.
  7. On the Edit menu, click Modify.
  8. In the Value data box, type 1.

STATUS

Microsoft has confirmed that this is a problem in Internet Explorer 6 Service Pack 1.

MORE INFORMATION

Steps to reproduce the problem

  1. Create an application that hosts the WebBrowser control, and then sink the DWebBrowserEvents2::FileDownload event. For more information about how to sink HTML document events, click the following article number to view the article in the Microsoft Knowledge Base:

    246247 How to sink HTML document events for WebBrowser host

  2. Paste the following code in Notepad, and then save the file as Frameset.htm:
     
    <frameset rows=50%,50%>
      <frame src="somepage.htm">
      </frame>
      <frame src="test.htm">
      </frame>
    </frameset>
     
  3. Paste the following code in Notepad, and then save the file as Test.htm:
    <html>
    <body>
    <a href="http://server/test.asp">test2</a>
    </body>
    </html>
  4. Write code to stream a file, and then save it as test.asp. For more information about how to stream a file from an ASP page, click the following article number to view the article in the Microsoft Knowledge Base:

    193998 How to read and display binary data in ASP

  5. Move to the Frameset.htm in your application that hosts the WebBrowser control, and then notice that the handler for the FileDownload event is not called.

REFERENCES

For more information, visit the following Microsoft Developer Network (MSDN) Web site:

Modification Type:MajorLast Reviewed:8/30/2006
Keywords:kbHotfixServer kbQFE kbIE600sp2fix kbIE600preSP2fix kbfix kbbug KB831306 kbAudDeveloper