Problem with resume file with IdFTP

Giganews Newsgroups
Subject: Problem with resume file with IdFTP
Posted by:  olesio (oles@no-spam.go2.cut-this.pl)
Date: Sun, 23 Sep 2007

Hello.

I'm using Delphi 7 with latest Indy 10 and I have problem with file resu=
me
while geting it from FTP server, which support resume. I set 3rd paramet=
er
and 4th parameter in Get function to False, True but this do not work :(=
A
file is downloading from begining - not resumed :( So what should I do, =
to
resume file transfer. Thanks in advice and sorry for my bad english ;) A=
nd
here is the code variants which I tested and both do not resume my file.=
...
[2ND variant was recomended as good in many sites which I found at googl=
e.
I ofcourse have parted downloaded file by TotalCommander - but progressb=
ar
in my app and Label.Caption - shows the file is downloaded from 0 bytes =
:(

[1ST]
</code>
var
LocalFile : TFileStream;
begin
IdFtp1.Host :=3D 'localhost';
IdFtp1.Port :=3D 21;
IdFtp1.UserName :=3D 'server';
IdFtp1.Password :=3D 'server';
IdFtp1.Passive :=3D True;
IdFtp1.Connect;

if IdFtp1.connected then
begin
IdFtp1.ChangeDir('PUB');
end;

if IdFtp1.CanResume =3D True then
begin
ShowMessage('This FTP support resume.');
end
else
begin
ShowMessage('This FTP DO NOT support resume!');
end;
LocalFile :=3D TFileStream.Create('D:\3.a', fmOpenReadWrite);
IdFtp1.Get('3.a', LocalFile, True);
LocalFile.Free;
IdFtp1.Disconnect;
end;
</code>

[2ND]
<code>
var
LocalFile : TFileStream;
begin
IdFtp1.Host :=3D 'localhost';
IdFtp1.Port :=3D 21;
IdFtp1.UserName :=3D 'server';
IdFtp1.Password :=3D 'server';
IdFtp1.Passive :=3D True;
IdFtp1.Connect;

if IdFtp1.connected then
begin
IdFtp1.ChangeDir('PUB');
end;

if IdFtp1.CanResume =3D True then
begin
ShowMessage('This FTP support resume.');
end
else
begin
ShowMessage('This FTP DO NOT support resume!');
end;
IdFtp1.Get('3.a', 'D:\3.a', False, True);
IdFtp1.Disconnect;
end;
</code>

-
Best Regards: olesio
(oles[at]go2[dot]pl)

Replies