TFTP Help required

TFTP Help required

Postby sanilpmc » Mon Mar 14, 2016 12:01 pm

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
sanilpmc
 
Posts: 36
Joined: Tue Jun 17, 2008 7:09 am

Re: TFTP Help required

Postby bosibila » Mon Mar 14, 2016 9:19 pm

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
Boris (FWH 20.07, xHarbour 1.2.3, Harbour 3.2.0, BCC74, MySql 5.7)
User avatar
bosibila
 
Posts: 53
Joined: Wed Aug 06, 2008 5:27 pm
Location: Osijek, Croatia

Re: TFTP Help required

Postby sanilpmc » Tue Mar 15, 2016 6:54 am

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


Thank you, Above code not working in both upload and download case(oFtp:uploadFile/oFtp:downloadFile). I found
Code: Select all  Expand view
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
sanilpmc
 
Posts: 36
Joined: Tue Jun 17, 2008 7:09 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 104 guests