Link to home
Start Free TrialLog in
Avatar of lundorff
lundorff

asked on

More about HTTPget

1) Is there a way to determind the filesize of a file before downloading it?

Rgs
Lund
Avatar of Alisher_N
Alisher_N

please be more specific...
what file you mean, and direction - upload to server/download from client ?

Avatar of lundorff

ASKER

Oh sorry please read this https://www.experts-exchange.com/questions/20398745/HTTPget-from-utilmind.html

I want to know if I can use the HTTPget component to easily determind the filesize of a file stored in the HTTPget1.?
I just took a look at the indy-component IdHTTP and it does has the size-function I need. How do I get a list of alle the links on a given page using the Indy component instead?
I just took a look at the indy-component IdHTTP and it does has the size-function I need. How do I get a list of alle the links on a given page using the Indy component instead?
I just took a look at the indy-component IdHTTP and it does has the size-function I need. How do I get a list of alle the links on a given page using the Indy component instead?
I just took a look at the indy-component IdHTTP and it does has the size-function I need. How do I get a list of alle the links on a given page using the Indy component instead?
let me see now.. this piece of code

procedure TForm1.Button4Click(Sender: TObject);
var
    test: TFileStream;
    size: integer;
begin
test := TFileStream.Create('c:\logo.mpeg',fmcreate);
IndyHTTP.Get('http://domain.com/logo.jpg',test);
test.Free
end;

will let me download the picture "logo.jpg" form domain.com but if I want to know the size of "logo.jpg" I must write the following before I download:

IndyHTTP.Head('http://domain.com/logo.jpg');
size := IndyHTTP.Response.ContentLenght;

The problem is that I acutally is downloading the picture twice in order to check it......... how do I check the filesize with downloading the file?

Rgs
Lund

ASKER CERTIFIED SOLUTION
Avatar of DaFox
DaFox

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hallo,
what do I need to declare in users in order to use "hInternet"? Im using Delphi 6

Rgs
Lund
Hallo,
what do I need to declare in users in order to use "hInternet"? Im using Delphi 6

Rgs
Lund
Works like a charm thx :)