Board index » delphi » Weird Download

Weird Download


2003-08-05 06:59:00 PM
delphi45
hi
I face this problem where i get the wrong content/response when i try to
download this link using TIdHTTP
www.he.net/cgi-bin/suid/~wol2wol/test/download.cgi?product=infopower&
filename=InfoPower4000Std_vcl6.exe
I check the the response of the Head() request, everything points to a file
which file size is 1024 bytes, however, the file that I am requesting should
be around 3 Mb.
I've already put HandleRedirect := True and some other possible settings
that i can think of.
May i know why i get this kind of response? Any help is appreciated.
Thanks in advance. =)
From,
Hon Yuen, Ng
 
 

Re:Weird Download

"Hon Yuen, Ng" <XXXX@XXXXX.COM>writes
Quote
I check the the response of the Head() request, everything
points to a file which file size is 1024 bytes, however, the
file that I am requesting should be around 3 Mb.
What does your actual code look like?
Gambit
 

Re:Weird Download

I did a simple example on it just now. My code looks like this
idHTTP1.Head(theURL);
ShowMessage(IntToStr(idHTTP1.Response.ContentLength));
 

Re:Weird Download

Hi Hon Yuen,
Try the following code after setting the necessary property in IdHTTP1 component, I get the content length right.
procedure XXXX();
var MemSrc, MemStream : TMemoryStream;
begin
MemoIn := TMemoryStream.Create;
MemStream := TMemoryStream.Create;
IdHTTP1.DoRequest(hmGet, 'www.he.net/cgi-bin/suid/
~wol2wol/test/download.cgi?
product=infopower&filename=
InfoPower4000Std_vcl6.exe',
memSrc, MemStream );
ShowMessage(IntToStr(idHTTP1.Response.ContentLength));
MemStream.SaveToFile('c:\InfoPower4000Std_vcl6.exe');
end;
Prasanta.
"Hon Yuen, Ng" <XXXX@XXXXX.COM>writes:
Quote
hi

I face this problem where i get the wrong content/response when i try to
download this link using TIdHTTP
www.he.net/cgi-bin/suid/~wol2wol/test/download.cgi?product=infopower&
filename=InfoPower4000Std_vcl6.exe

I check the the response of the Head() request, everything points to a file
which file size is 1024 bytes, however, the file that I am requesting should
be around 3 Mb.

I've already put HandleRedirect := True and some other possible settings
that i can think of.

May i know why i get this kind of response? Any help is appreciated.

Thanks in advance. =)

From,
Hon Yuen, Ng