Well, I would like to know how to find out the size of the file being downloaded with the IdHttp component.
Well, I would like to know how to find out the size of the file being downloaded with the IdHttp component.
You have to request the HEAD operation with the file address
var
HttpClient: TIdHttp;
FileSize: Int64;
begin
HttpClient := TIdHttp.Create(nil);
try
HttpClient.Head('http://somewhere.com/somefile.exe');
FileSize := HttpClient.Response.ContentLength;
finally
HttpClient.Free;
end;
end;