Export (0) Print
Expand All

TriggerFileDownload Function

New for Windows Internet Explorer 9

Directs Internet Explorer to download a file.

Syntax


typedef HRESULT STDAPICALLTYPE TRIGGERFILEDOWNLOADFN (
    LPCWSTR lpszURL
);

Parameters

lpszURL
[in] A pointer to the URL of the file to download.

Return Value

Returns one of the following values.

S_OK The operation completed successfully.
E_FAIL The function was called from an invalid process.

Remarks

The TriggerFileDownload function is designed to allow Browser Helper Objects (BHOs) to request Internet Explorer to download a file. Consequently, the function is allowed only from the process that hosts BHOs.

When you call TriggerFileDownload, the user is prompted to download the file passed as the lpszURL parameter. If the user cancels the confirmation dialog box, the file is not downloaded.

For security reasons, the confirmation dialog box is displayed for all file downloads requested using TriggerFileDownload, even if the user has previously specified files of similar types to always open.

Function Information

Stock Implementation ieframe.dll
Custom Implementation No
Import library None
Minimum availability Internet Explorer 9
Minimum operating systems Windows Vista

Community Additions

ADD
Show:
© 2014 Microsoft