Page 1 of 1
TFTP Help required
Posted: Mon Mar 14, 2016 12:01 pm
by sanilpmc
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
Re: TFTP Help required
Posted: Mon Mar 14, 2016 9:19 pm
by bosibila
Sanil,
here is example from this forum. I adapted some lines in my application:
Code: Select all
//---------------------------------------------------------------------------------------------------------------------
//
// 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
Re: TFTP Help required
Posted: Tue Mar 15, 2016 6:54 am
by sanilpmc
bosibila wrote:Sanil,
here is example from this forum. I adapted some lines in my application:
Code: Select all
//---------------------------------------------------------------------------------------------------------------------
//
// 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
Thank you, Above code not working in both upload and download case(oFtp:uploadFile/oFtp:downloadFile). I found
Code: Select all
INETERRORCODE (<pointer>) >> -4 <<
in ftp.log. When I search this error in google, found that SSL is the issue. So how can I overcome this.
Regards
Sanil