IDFTP TransferMode(dmDeflate);

Giganews Newsgroups
Subject: IDFTP TransferMode(dmDeflate);
Posted by:  Theart (nyxsn…@126.com)
Date: Fri, 3 Apr 2009

procedure TForm1.Button1Click(Sender: TObject);
var
LCompressor: TIdCompressorZLib;
begin
idftp1.Username :='zhuixin';
idftp1.Password :='zhuixin';
idftp1.Host :='218.15.153.134';

LCompressor:= TIdCompressorZLib.Create (nil);
idftp1.Compressor := LCompressor;

idftp1.Connect ;
idftp1.TransferMode(dmDeflate);
tsize:=idftp1.Size('/AvatarIcon.pack');
idftp1.Get('/AvatarIcon.pack','C:\AvatarIcon.pack',true);
LCompressor.Free ;
idftp1.Disconnect ;

showmessage('ok')    ;
end;

procedure TForm1.IdFTP1Work(ASender: TObject; AWorkMode: TWorkMode;
  AWorkCount: Int64);
begin

Gauge1.Progress := trunc(AWorkCount/tsize*100)  // --> Gauge1.Progress is wrong
end;

Replies