Gets the size of the remote file or the length of the response at the given URL.
type
TReadMethod = (rmGet, rmPost, rmActive, rmPassive);
#ifdef UNICODE // For UNICODE Inno Setup
function DwinsHs_GetRemoteSize(URL, Agent: AnsiString; Method: TReadMethod): Int64;
#else // For ANSI Inno Setup
function DwinsHs_GetRemoteSize(URL, Agent: AnsiString; Method: TReadMethod): LongInt;
#endif
The full address of the file to check the size of, or the address of server script to check the length of its response. the "http", "https" and "ftp" schemes are supported. Optional username, password and port number can be included. For "http" and "https" schemes, an optional parameters string can be included too.
Format:
[<scheme>://][<username>[:<password>]@]<host>[:<port>] [/<path>][?<parameters>]
For example:
http://username:[email protected]:8080/images/file.jpg
https://www.mywebsite.com/license/verify.php?license_key=xxx-xxx-xxx-xxx&license_type=2
ftp://username:[email protected]:2121/images/file.jpg
Specifies an user agent string. Your server can use the string to determine whether the request is sent by your installation package, or determine which installation package sends the request, etc.
Specifies the HTTP methods for an "http" or "https" request. Or specifies the transfer mode for an "ftp" request. It can be one of the following values:
Returns the file size or the response length in bytes if successful, a negative integer otherwise, its absolute value indicates the error code:
If the error code is between 1 and 6, you can call the DllGetLastError function to retrieve a specific error message.
If you want fetch the length of response at the given URL, the Content-Length entity-header field is required on response from your server.