Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: The FileDownload event does not always fire


View products that this article applies to.

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.

↑ Back to the top


Resolution

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site: Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

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
				

↑ Back to the top


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.

↑ Back to the top


Status

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

↑ Back to the top


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.

↑ Back to the top


References

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

↑ Back to the top


Properties

Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

↑ Back to the top


Keywords: KB831306, kbbug, kbfix, kbie600presp2fix, kbie600sp2fix, kbqfe, kbhotfixserver, kbautohotfix

↑ Back to the top

Article Info
Article ID : 831306
Revision : 6
Created on : 11/15/2007
Published on : 11/15/2007
Exists online : False
Views : 431