Hello.
I need help with FtpSend.
How can I get status about StoreFile function?
When I use fttpsend and I try to append text on a Memo(log), The memo doesn't update immediately. It shows all text after Ftpsend has ended or log out. Why? or How can I run log.append function after StoreFile function?.
This code run perfectly, It uploads the files on my web but Log.Append shows all messages when Ftpsend is log out. I want to show messages while it is uploaded each file. How can I do that?
Arch:=TStringList.Create;
//Change carpeta.php file
Arch.LoadFromFile(RutaWebLocal+'carpetas.php');
Arch.Strings[1]:=' $WEB="web"; //local o web';
Arch.SaveToFile(RutaWebLocal+'carpetas.php');
TFTPCliente:=TFTPSend.Create;
TFTPCliente.TargetHost:='xxx.com';
TFTPCliente.TargetPort:='21';
TFTPCliente.UserName:='xxx';
TFTPCliente.Password:='xxx';
if TFTPCliente.Login then
Begin
Log.Append('Entrando');
TFTPCliente.ChangeWorkingDir('/');
TFTPCliente.DirectFile:=True;
for i:=0 to Memo2.Lines.Count-1 do
begin
//Get file from a list, each line is file in Memo2.
aux1:=Memo2.Lines.Strings[i];
delete(aux1,1,pos('/',aux1)-1);
aux2:=StringReplace(aux1,RutaWebLocal,'',[rfReplaceAll]);
aux2:=trim(aux2);
TFTPCliente.DirectFileName:=aux1;
TFTPCliente.StoreFile(RutaWeb+aux2,true);
Log.Append('.')
end;
TFTPCliente.Logout;
Log.Append('Saliendo');
end
else Log.Append('No entro');
TFTPCliente.Free;