FIX: The FileDownload event does not always fire

Article translations Article translations
Article ID: 831306
This article has been archived. It is offered "as is" and will no longer be updated.
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
Expand all | Collapse all

On This Page

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 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:
http://support.microsoft.com/contactus/?ws=support
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
				

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:
http://msdn2.microsoft.com/en-us/library/Aa768284.aspx

Properties

Article ID: 831306 - Last Review: June 20, 2014 - Revision: 4.0
Keywords: 
kbnosurvey kbarchive kbautohotfix kbhotfixserver kbqfe kbie600sp2fix kbie600presp2fix kbfix kbbug KB831306

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com