title: Delphi: Use TidHTTPServer for transfer file and monitoring byte send for single request
body: <p>Using <code>TIdHTTPServer</code> (Indy 10.6), how do track how many bytes are sent to the client (user browser) for each request (on close connection)?</p>
  
  <pre><code>procedure onCommandGet(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo;
  begin
      AResponseInfo.ContentStream := TFileStream.Create('C:/HugeFile.zip', fmOpenRead or fmShareCompat);
      AResponseInfo.ContentLength := AResponseInfo.ContentStream.Size;
      AResponseInfo.WriteHeader;
      AResponseInfo.WriteContent;
      AResponseInfo.ContentStream.Free;
      AResponseInfo.ContentStream := nil;
  end;
  </code></pre>
  
  <p>eg, in a log file:</p>
  
  <pre>
  2014-11-06 20:32:00 - IPAddress 84.XXX.XXX.XXX download 1000000 Bytes (100%)
  2014-11-05 16:05:00 - IPAddress 72.XXX.XXX.XXX download 500000  Bytes (50%)
  </pre>