Microsoft KB Archive/831306

= FIX: The FileDownload event does not always fire =

Article ID: 831306

Article Last Modified on 11/15/2007

-

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.



Hotfix information
A supported hotfix is now 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 service pack that contains this hotfix.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

http://go.microsoft.com/?linkid=6294451

Note If additional issues occur or 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. To create a separate service request, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

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:

To work around this problem, follow these steps:
 * 1) Start Registry Editor.
 * 2) Locate and then click one of the following registry subkeys:
 * 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.
 * 1) On the Edit menu, click Modify.
 * 2) In the Value data box, type 1.



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



Steps to reproduce the problem
 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

  Paste the following code in Notepad, and then save the file as Frameset.htm:      Paste the following code in Notepad, and then save the file as Test.htm: <a href=&quot;http://server/test.asp&quot;>test2</a> </li> 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

</li> 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.</li></ol>

<div class="references_section">