Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tIPcleintFtp() - What's changed?

77 views
Skip to first unread message

Jeff Barnes

unread,
Feb 6, 2013, 3:26:15 PM2/6/13
to
Hello,

I have copied code directly from an older app of mine that worked perfectly.
Not sure what rev of xHarbour but it was from a few years ago.

xHarbour 1.2.1. Rev 9421 no longer connects to my ftp site.

Can anyone tell me why it no longer works?


Here is the code I am working with:

cUrl := "ftp://myUser:myP...@mySite.net"
oUrl := tUrl():New(cUrl)

oFtp := tIPClientftp():New(oUrl,.t.)
oFtp:nConnTimeout := 60000
oFtp:bUsePasv := .t.

IF oFtp:open(cUrl)
IF oFtp:UpLoadFile(cZipFile)
MsgInfo("Sent")
ELSE
MsgInfo("Not Sent")
ENDIF
oFtp:Close()
ELSE
MsgInfo("Not Connected") // <-- This is always the response
ENDIF


Thanks,
Jeff

Jeff Barnes

unread,
Feb 6, 2013, 8:17:34 PM2/6/13
to
If there is no fix for the above ....
Is there another way to send a file to and ftp site?
Or a way to send an email in the background that does not require an email client on the users pc?

Stefan Haupt

unread,
Feb 7, 2013, 2:55:11 AM2/7/13
to
I confirm this error, the sample is working fine with release 9411, it is
no more working with release 9804.

the log file (9411)
--------------------------
20130206-16:46:46 :INETRECVLINE( 2136120, , 128 )
>> 230 User xxx logged in <<

20130206-16:46:46 :INETERRORCODE( 2136120 )
>> 0 <<

20130206-16:46:46 :INETSENDALL( 2136120, 8, TYPE I )
>> 8 <<

20130206-16:46:46 :INETRECVLINE( 2136120, , 128 )
>> 200 Type set to I <<

20130206-16:46:46 :INETERRORCODE( 2136120 )
>> 0 <<

20130206-16:47:46 :INETRECVLINE( 2136120, , 128 )
>> NIL <<

20130206-16:47:46 :INETSENDALL( 2136120, 6, PASV )
>> 6 <<

20130206-16:47:46 :INETRECVLINE( 2136120, , 128 )
>> 227 Entering Passive Mode (141,51,121,200,211,93). <<

20130206-16:47:46 :INETERRORCODE( 2136120 )
>> 0 <<

20130206-16:47:46 :INETSENDALL( 2136120, 15, STOR Test.zip )
>> 15 <<

20130206-16:47:46 :INETERRORCODE( 21362F4 )
>> 0 <<

20130206-16:47:46 :INETRECVLINE( 2136120, , 128 )
>> 150 Opening BINARY mode data connection for Test.zip <<

20130206-16:47:46 :INETERRORCODE( 2136120 )
>> 0 <<

20130206-16:47:46 :INETSENDALL( 21362F4, 2063, ..... )
>> 2063 <<

20130206-16:47:46 :INETRECVLINE( 2136120, , 128 )
>> 226 Transfer complete <<

20130206-16:47:46 :INETERRORCODE( 2136120 )
>> 0 <<


the log file (9804)
--------------------------
20130207-08:22:41 :INETRECVLINE( 29D7D0, , 128 )
>> 230 User xxx logged in <<

20130207-08:22:41 :INETERRORCODE( 29D7D0 )
>> 0 <<

20130207-08:22:41 :INETSENDALL( 29D7D0, 8, TYPE I )
>> 8 <<

20130207-08:22:41 :INETRECVLINE( 29D7D0, , 128 )
>> 200 Type set to I <<

20130207-08:22:41 :INETERRORCODE( 29D7D0 )
>> 0 <<

20130207-08:23:41 :INETRECVLINE( 29D7D0, , 128 )
>> NIL <<

20130207-08:23:41 :INETSENDALL( 29D7D0, 7, CWD / )
>> 7 <<

20130207-08:23:41 :INETRECVLINE( 29D7D0, , 128 )
>> 250 CWD command successful <<

20130207-08:23:41 :INETERRORCODE( 29D7D0 )
>> 0 <<

20130207-08:23:41 :INETERRORCODE( 29D910 )
>> 0 <<

20130207-08:23:41 :INETSENDALL( 29D7D0, 25, PORT 192,168,0,4,62,129 )
>> 25 <<

20130207-08:23:41 :INETRECVLINE( 29D7D0, , 128 )
>> 500 Illegal PORT command <<

20130207-08:23:41 :INETERRORCODE( 29D7D0 )
>> 0 <<

cul...@gmail.com

unread,
Feb 7, 2013, 4:12:32 AM2/7/13
to
Hi

set oFtp:bUsePasv to .f.

Regards
Luiz

Stefan Haupt

unread,
Feb 7, 2013, 6:32:56 AM2/7/13
to
Done, no effect

Jeff Barnes

unread,
Feb 7, 2013, 1:07:31 PM2/7/13
to
Got it working.

Here is the code that finally worked....


cUrl := "ftp://MyUser:MyPas...@MyServer.com"
oUrl:=TUrl():NEW( cUrl )
oUrl:cUserID:="MyUser"
oUrl:cPassword:="MyPassword"
oUrl:cServer:="MyServer.com"
oUrl:cAddress:="ftp://MyUser:MyPas...@MyServer.com"

oFtp:=TIPClientFTP():New( oUrl )
IF .NOT. oFtp:open()
MsgInfo("Error: Could not connect."+CRLF+ oFtp:lastErrorMessage(),"ERROR" )
ELSE
IF oFtp:UpLoadFile(cFile)
MsgInfo("sent")
ELSE
MsgInfo("not sent")
ENDIF
oFtp:Close()
ENDIF




On Wednesday, February 6, 2013 3:26:15 PM UTC-5, Jeff Barnes wrote:
0 new messages