This is my first experience in FTP, I am using tFtp to upload and download a small text file. But it is not working. Please any one can put a working code for upload and download a small text file.
Regards
Sanil
//---------------------------------------------------------------------------------------------------------------------
//
// FTPsend( "list.txt", "Text message ..." )
//
//---------------------------------------------------------------------------------------------------------------------
FUNCTION FTPsend(list,message)
LOCAL cUrl := "ftp://user:password@ftp.site.com"
LOCAL oUrl := TUrl():New( cUrl )
LOCAL oFtp := TIpClientFtp():New( oUrl, .t. )
oFtp:Open( cUrl )
lOk:=oFtp:uploadFile(list,"/var/www/wordpress/temp/"+list)
oFtp:Close()
if !empty( message )
if lOk
msgWait( message,,1.5 )
else
msgInfo( "Error ..." )
endif
endif
RETURN nil
bosibila wrote:Sanil,
here is example from this forum. I adapted some lines in my application:
- Code: Select all Expand view
//---------------------------------------------------------------------------------------------------------------------
//
// FTPsend( "list.txt", "Text message ..." )
//
//---------------------------------------------------------------------------------------------------------------------
FUNCTION FTPsend(list,message)
LOCAL cUrl := "ftp://user:password@ftp.site.com"
LOCAL oUrl := TUrl():New( cUrl )
LOCAL oFtp := TIpClientFtp():New( oUrl, .t. )
oFtp:Open( cUrl )
lOk:=oFtp:uploadFile(list,"/var/www/wordpress/temp/"+list)
oFtp:Close()
if !empty( message )
if lOk
msgWait( message,,1.5 )
else
msgInfo( "Error ..." )
endif
endif
RETURN nil
Best regards,
Boris
INETERRORCODE (<pointer>) >> -4 <<
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 118 guests