DwinsHs_GetRemoteSize function

Gets the size of the remote file or the length of the response at the given URL.

Declaration:

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

Parameters:

Return:

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.

Note:

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.