FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Send and Receive for FTP
Posts: 49
Joined: Thu Dec 22, 2005 12:50 PM
Send and Receive for FTP
Posted: Sat Nov 14, 2009 04:47 PM
The code below shows the files from the ftp. I would like an example of sending and receiving a file via ftp.

Code (fw): Select all Collapse
#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

   local oInternet := TInternet():New()
   local oFTP      := TFTP():New( "ftp.brturbo.com.br", oInternet,"usuariodemo","senha123" ) 
   local aFiles

   if ! Empty( oFTP:hFTP )
      aFiles = oFTP:Directory( "*.*" )
      AEval( aFiles, { | aFile | MsgInfo( aFile[ 1 ], aFile[ 3 ] ) } )
   else
      MsgAlert( "oFTP:hFTP is null" )
   endif

   oInternet:End()

   MsgInfo( "Done!" )

return nil
Kleyton

Fwh906

Brazil
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Send and Receive for FTP
Posted: Sat Nov 14, 2009 05:38 PM
Best regards,
Otto

//? FTPGETFILE( hConnect, "Your remote file", "Your local file", 0, FILE_ATTRIBUTE_ARCHIVE, 0, 0 )
//? FTPPUTFILE( hConnect, "Your local file", "Your remote file", 0, 0 )


Code (fw): Select all Collapse
IF len(aFiles) > 0

AEval( aFiles, { | aFile | FtpGetFile (oFTP:hFTP,aFile[ 1 ], "c:\dbf\" + aFile[ 1 ] ,.t.,0,0,0 ) ,;
oFTP:DeleteFile( aFile[ 1 ]) } )

ENDIF


FTPPUTFILE( oFTP:hFTP, "test.pdf", "/testserver/STB1/test.pdf", 0, 0 )
Posts: 49
Joined: Thu Dec 22, 2005 12:50 PM
Re: Send and Receive for FTP
Posted: Mon Nov 16, 2009 05:10 PM

Otto, thank you for responding.
where I find the manual on this process of ftp?

Kleyton

Fwh906

Brazil

Continue the discussion