* --- Declare my API in urlmon.dll
DECLARE INTEGER URLDownloadToFile IN urlmon.dll;
INTEGER pCaller, STRING szURL,;
STRING szFileName, INTEGER dwReserved,;
* --- Declare my local memory variables used in this routine.
LOCAL cRemoteFile, cLocalFile, nResult
* --- SOURCE: Set my URL via HTTP into the domain and path if required and file name.
* --- This is a folder on webserver with access permissions for anonymous logged
* --- in user. In this case website running under IIS.
cRemoteFile = "http://www.marathongriffincomputers.com/FieldMobi.exe"
* --- TARGET: Set a valid path where to download the file into.
cLocalFile = "D:\DownloadFolder"
* --- Call the download API.
nResult = URLDownloadToFile(0, cRemoteFile, cLocalFile, 0,0)
* --- Test the results of the download.
IF nResult = 0
? "The file has been downloaded."
? "The URLDownloadToFile call failed with error code:", nResult