A ver si te sirve este sample, yo lo hago así:
// Chequeo de Conexión
MsgRun( "Conectando con FTP...", "Aguarde...",;
{ || ::oInternet:= TInternet():New(),;
if( lConxOk:= !Empty( ::oInternet:hSession ), ;
( ::oFTP:= TFTP():New( _SITIO, ::oInternet, _USER, _PASSW ), ;
if( lConxOk:= !Empty( ::oFTP:hFTP ), nil, ;
( Alert( "No se puede conectar con el sitio FTP:"+CRLF+ ;
_SITIO+CRLF+"reintente luego",, "Imposible continuar",, IDI_HAND, TRUE ), ;
::oInternet:End() ) ) ), ;
( Alert( "Sesión de Internet no disponible!",, "Lo siento" ), ;
::oInternet:End() ) ) } )
// En otro metodo chequeo la existencia del archivo que voy a descargar
...
cWebPath:= "public_html/backup/"
aFileBack:= ::oFTP:Directory( cWebPath+cArchUnPack )
if ! aFileBack[1][F_SIZE] == 0
aFuenteW := { cWebPath+cArchUnPack }
aDestinoHD:= { cPathUnPack+"\"+cArchUnPack }
else
Alert( "No existe el archivo "+Upper( cArchUnPack )+" !"+CRLF+ ;
"en el sitio: "+_SITIO+CRLF+ ;
"Verifique que hayan hecho la copia de seguridad",, "Imposible Restaurar",, IDI_HAND, TRUE )
return( nil )
end