Problem with resume file in IdFTP.

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

Hello. Sorry if my post was here before - I don't seen it in Opera.

I'm using Delphi 7 with latest Indy 10 and I have problem with file
resume while geting it from FTP server, which support resume. I set
3rd parameter and 4th parameter in Get function to: False, True but
this don't 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 ;) And below is the code variants, which I
tested and both do not resume my file. 2ND variant - was recomended
as good in many webs which I found at google I ofcourse have parted
downloaded file by TotalCommander - but progressbar in my app and a
Label.Caption shows the file is downloaded from 0 bytes :( My code:

[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