Y así cuando subo un fichero y ya existe en el servidor, se trata de un fragmento de código a modo de ejemplo:
Código Delphi
[-]procedure TfrExpterminales.btSubirClick(Sender: TObject);
var
F: File of byte;
sArchivo:String;
begin
cSubirFichero:= cCaminoZipExp+'Dat010'+Vendedor+'.Zip';
AssignFile( F, cSubirFichero );
Reset( F );
CloseFile( F );
btListar.Click;
if btConectar.Enabled = False then
begin
pnMensajes.Color:=ClBlack;
try
IdFTP.Delete('Dat010'+Vendedor+'.Zip');
Except
end;
Try
IdFTP.Put( cSubirFichero, ExtractFileName( cSubirFichero ), False );
except
ShowMessage('Se produjo un error al subir el fichero.');
end;
pnMensajes.Caption:='';
pnMensajes.Color:=clBtnFace;
btListar.Click;
end
else
ShowMessage('Primero tiene que conectar con el servidor.');
end;
Un Saludo.