When this method is called after a GET or POST request has completed,
the lpLength parameter will contain the total number of bytes
returned by the server. If this method is called while a request is
being processed (for example, from within an event handler), it will
return the value of the Content-Length response header provided by the
server.
Most servers will only include a Content-Length header in the
response for static resources like documents or image files. For other
types of resources where the response payload is generated
dynamically, such as server-side scripts, servers typically use
"chunked" output and there is no Content-Length header.
The server may also not provide a file size for HTML documents which
use server side includes (SSI) because that content is also dynamically
created by the server. In this case, the content length can only be
determined after the request has completed.
This method should only be used after a request has completed and
will not return a value for dynamic resources as they are being
retrieved from the server. To obtain the current number of bytes copied
from within an event handler, use the GetTransferStatus
method.
If the content type for the current resource is textual, the
content length reported by the server may be different than what is
stored on the local system due to different end-of-line character
conventions. For example, on Windows the end of a line of text is
indicated by a carriage-return and linefeed pair, while on Linux the
end-of-line is indicated by a single linefeed. Depending on the
options specified when the request is made, text returned by the
server may be normalized for the Windows platform.
This method does not use the HEAD command to request the size of
a document on the server. It will only return the content length of a
resource which has already been requested, typically after using
methods such as GetText or PostXml. To ask the
server for the size of document without downloading the contents of
that document, use the GetFileSize method.