FTP - TO ENRICO

FTP - TO ENRICO

Postby karinha » Wed Feb 25, 2015 6:53 pm

Please Enrico what I'm doing wrong?

In Portuguese: Enrico, o que estou fazendo errado?

Code: Select all  Expand view

   IF Len( aFiles ) > 0

      oUrl              := tUrl():New( cUrl )

      oFTP              := tIPClientFtp():New( oUrl, .T. )

      oFTP:Open(cUrl)  

      cMyPath:="\teste"

      oFTP:CWD( cMyPath ) // Enrico, Do not change the directory...

      oFTP:nConnTimeout := 20000
      oFTP:bUsePasv     := .T.

      IF oFTP:Open()=.f.

         usooff="S"

         MsgStop( "Nao conectou", "Atencao" )

         RETURN .F.

      endif

      if oFTP:Cwd( cMyPath )=.f.

         MsgStop( "Nao abriu pasta: "+cMyPath, "Atencao" ) // Do not change the directory..

         //oFTP:MKD(cMyPath)  // Cria o diretorio

         //return .f.

      endif

      oFTP:Cwd(cMyPath)  
      oFTP:reset()
 


Regards
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7213
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: FTP - TO ENRICO

Postby karinha » Wed Feb 25, 2015 7:33 pm

Enrico, I would like to put the teste.txt file in the teste folder.

It does not work.

Image

Regards,
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7213
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: FTP - TO ENRICO

Postby Enrico Maria Giordano » Wed Feb 25, 2015 10:09 pm

João,

works fine here:

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL cUrl := "ftp://myuser@aruba.it:mypassword@ftp.emagsoftware.it"

    LOCAL oUrl := TUrl():New( cUrl )

    LOCAL oFtp := TIpClientFtp():New( oUrl, .T. )

    oFtp:Open( cUrl )

    ? oFtp:CWD( "/emagsoftware.it" )

    ? oFtp:DownloadFile( "email.gif" )

    oFtp:Close()

    RETURN NIL


Are you using the latest version of Harbour or xHarbour?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: FTP - TO ENRICO

Postby karinha » Thu Feb 26, 2015 12:15 pm

Hi Enrico, FWH13.06 and,

Code: Select all  Expand view

xHarbour 1.2.3 Intl. (SimpLex) (Build 20141206)
Copyright 1999-2014, http://www.xharbour.org http://www.harbour-project.org/
 


Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7213
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 21 guests