FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour oFtp:DIRECTORY('*.*',"HD") -> Binary
Posts: 257
Joined: Tue May 16, 2006 04:46 PM
oFtp:DIRECTORY('*.*',"HD") -> Binary
Posted: Wed Aug 31, 2011 06:50 PM

Hola de nuevo,

Soy nuevo en lo relacionado a FTP. Ya cuento con un sito FTP pero no he logrado bajar archivos aun tomando en cuenta todos los ejemplos que he visto.

El problema radica basicamente en que al abrir un oFtp y despues usar oFtp:DIRECTORY('.',"HD") con xbrowse siempre me da elementos que dicen "Binary", a que se puede deber?

Salu2

RodolfoRBG
FWH 1307, xHarbour123 BCC582
rodolfoerbg@gmail.com
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: oFtp:DIRECTORY('*.*',"HD") -> Binary
Posted: Thu Sep 01, 2011 09:04 AM
Please check your landing directory while connecting FTP.
Please check the folder name, I believe that it is case sensitive.
Please verify that you have permission in the directory which you are trying to list.

I check the availability of a file in a particular folder using the below given code
Code (fw): Select all Collapse
aFiles:=oFtp:Directory("Web/cstock/CStock.exe" )


Regards
Anser
Posts: 1380
Joined: Fri Oct 14, 2005 01:28 PM
Re: oFtp:DIRECTORY('*.*',"HD") -> Binary
Posted: Thu Sep 01, 2011 12:33 PM
A ver si te sirve este sample, yo lo hago así:

Code (fw): Select all Collapse
   // 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
Resistencia - "Ciudad de las Esculturas"

Chaco - Argentina

Continue the discussion