URLDownloadToFile

Downloads a file from the Internet.

URLDownloadToFile, URL, Filename

 

Parameters

URL URL of the file to download. For example, http://someorg.org might retrieve the welcome page for that organization.
Filename Name of the file to be created locally, which is assumed to be in %A_WorkingDir% if an absolute path isn't specified. Any existing file will be overwritten by the new file.

 

ErrorLevel

ErrorLevel is set to 1 if there was a problem or 0 otherwise.

 

Remarks

The download might appear to succeed even when the remote file doesn't exist. This is because many web servers send an error page instead of the missing file. This error page is what will be saved in place of Filename.

Internet Explorer 3 or greater must be installed for this function to work. Firewalls or the presence of multiple network adapters may cause this function to fail. Also, some websites may block such downloads.

The file is obtained from IE cache whenever possible. You might be able to force a (re)download from the Internet by supplying a fake cgi parameter, for example: "http://.../test.exe?fakeParam=42"

 

Related

FileCopy

 

Examples

URLDownloadToFile, http://www.someorg.org, c:\SomeOrg's Welcome.htm

URLDownloadToFile, http://someorg.org/archive.zip, c:\SomeOrg's Archive.zip