FTP - TO ENRICO

Post Reply
User avatar
karinha
Posts: 7917
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

FTP - TO ENRICO

Post by karinha »

Please Enrico what I'm doing wrong?

In Portuguese: Enrico, o que estou fazendo errado?

Code: Select all | Expand


   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: 7917
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: FTP - TO ENRICO

Post by karinha »

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
Enrico Maria Giordano
Posts: 8736
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 1 time
Contact:

Re: FTP - TO ENRICO

Post by Enrico Maria Giordano »

João,

works fine here:

Code: Select all | Expand

#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
karinha
Posts: 7917
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: FTP - TO ENRICO

Post by karinha »

Hi Enrico, FWH13.06 and,

Code: Select all | Expand


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
Post Reply