Function Reference

InetGetSize

Returns the size (in bytes) of a file located on the internet.

InetGetSize ( "URL" [, options ] )

 

Parameters

URL URL of the file to download. See remarks below.
options [optional] 0 = (default) Get the file from local cache if available.
1 = Forces a reload from the remote site.
2 = Ignore all SSL errors (with HTTPS connections).
4 = Use ASCII when transfering files with the FTP protocol (Can not be combined with flag 8).
8 = Use BINARY when transfering files with the FTP protocol (Can not be combined with flag 4). This is the default transfer mode if none are provided.

 

Return Value

Success: Returns the size of the file in bytes.
Failure: Returns 0 and sets @error to non-zero.

 

Remarks

Internet Explorer 3 or greater must be installed for this function to work. (For ftp:// URLs IE 5 is required!)

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"

Not all servers will correctly give the file size, especially when using a proxy server.

 

Related

InetGet, InetRead, HttpSetProxy, FtpSetProxy, HttpSetUserAgent

 

Example


Local $nSize = InetGetSize("http://www.autoitscript.com/autoit3/files/beta/update.dat")
MsgBox(0, "Size of remote file:", $nSize)