Help and Support
 

powered byLive Search

How To Download a File Without Prompting

Article ID:244757
Last Review:July 1, 2004
Revision:2.1
This article was previously published under Q244757

SUMMARY

The WebBrowser control and Internet Explorer have Save and Save As options that can be used to save files using the ExecWB command. However, this involves prompting from the user. There is no way to suppress this prompt. To save files to the hard-disk without prompting, use the URLDownloadToFile API from URLMON.

Back to the top

MORE INFORMATION

The declaration for URLDownloadToFile is as follows:
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal _
szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
				

The function can be called as follows:
returnValue = URLDownloadToFile(0, "http://www.microsoft.com/ms.htm", _
"c:\ms.htm", 0, 0)
				
Note that when downloading HTML files, embedded content like images and objects will not be downloaded.

Back to the top

REFERENCES

URL Monikers Functions (http://msdn.microsoft.com/workshop/networking/moniker/reference/functions/functions.asp)

Back to the top


APPLIES TO
Microsoft Internet Explorer 4.0 128-Bit Edition
Microsoft Internet Explorer 4.01 Service Pack 2
Microsoft Internet Explorer 4.01 Service Pack 1
Microsoft Internet Explorer 5.0
Microsoft Internet Explorer 5.01
Microsoft Internet Explorer 5.5
Microsoft Visual Basic 5.0 Learning Edition
Microsoft Visual Basic 6.0 Learning Edition
Microsoft Visual Basic 5.0 Professional Edition
Microsoft Visual Basic 6.0 Professional Edition
Microsoft Visual Basic 5.0 Enterprise Edition
Microsoft Visual Basic 6.0 Enterprise Edition

Back to the top

Keywords: 
kbhowto kburlmon kbwebbrowser KB244757

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.