###Function###
InetGet

###Description###
Downloads a file from the internet using the http or ftp protocol.

###Syntax###
InetGet ( "URL" [,"filename" [, reload [, background]]] )


###Parameters###
@@ParamTable@@
URL
	URL of the file to download.  See remarks below. Can be "abort".
filename
	[optional]
	Local filename to download to.
reload
	[optional]
	0 = (default) Get the file from local cache if available
	1 = Forces a reload from the remote site
background
	[optional]
	0 = (default) Wait until the download is complete before continuing.
	1 = return immediately and download in the background (see remarks).
@@End@@


###ReturnValue###
@@ReturnTable@@
Success:	Returns 1.
Failure:	Returns 0.
@@End@@


###Remarks###
Internet Explorer 3 or greater must be installed for this function to work.

The URL parameter should be in the form "http://www.somesite.com/path/file.html" - just like an address you would type into your web browser.

To use a username and password when connecting simply prefix the servername with "username:password@", e.g.
"http://myuser:mypassword@www.somesite.com"

The InetGet function works with http:// https:// and ftp:// - to change the transfer type when using ftp see the FtpBinaryMode option.


<b>&quot;background&quot; Parameter</b>

By default the function waits until the download has finished before returning.  Sometimes with large downloads this is not always wanted.  If the <b>background</b> parameter is set to 1 the function returns immediately and the download continues in the background.  When in this mode two macros are used to keep track:
@InetGetActive = 1 while downloading, or 0 when finished.
@InetGetBytesRead = the number of bytes downloaded, or -1 if there has been an error.

Note, only one download can be active at once, if you call the function again before a download is complete it will fail.

To abort a download call the function with just the first parameter set to "abort" like so:
<p class="codebox">InetGet("abort")</p>

###Related###
FtpBinaryMode (Option), FtpSetProxy, InetGetSize, HttpSetProxy,  


###Example###
@@IncludeExample@@
