FTP - I receive the wrong IP

Blitz3D Forums/Blitz3D Beginners Area/FTP - I receive the wrong IP

no nickname(Posted 2007) [#1]
Hi,

I want to communicate with my FTP-Account(s) using BB. But there occoured a problem while connecting to the server. In the message answering "PASV" the server returns his local IP, not his "Online-IP". So I can't create a data-stream :-(

The code looks like this:

;ftpstream=OpenTCPStream("www.bbbemil.serveftp.org",21)
ftpstream=OpenTCPStream("people-ftp.freenet.de",21)
If ftpstream<>0 Then
Repeat
txt$=ReadLine(ftpstream)
Until txt$<>""
WriteLine ftpstream,"USER *****"
txt$=""
Repeat
txt$=ReadLine(ftpstream)
Until txt$<>""
WriteLine ftpstream,"PASS *****"
;Prepare for Download
WriteLine(ftpstream,"PASV")
txt$=""
Repeat
txt$=ReadLine(ftpstream)
If txt$<>"" Then DebugLog txt$
Until Left(txt$,3)="227"
DebugLog txt$
;Parse Answer
txt$=Mid(txt$,Instr(txt$,"("))
txt$=Mid(txt$,2,Len(txt$)-2)
DebugLog txt$
index1=Instr(txt$,",")
index2=Instr(txt$,",",index1+1)
index3=Instr(txt$,",",index2+1)
index4=Instr(txt$,",",index3+1)
index5=Instr(txt$,",",index4+1)
ip$=Replace(Mid(txt$,1,index4-1),",",".")
DebugLog "IP:"+ip$
port=(Int(Mid(txt$,index4+1,index5-index4-1))*255)+Int(Mid(txt$,index5+1))
DebugLog "Port:"+port
transfer=OpenTCPStream(ip$,port)
If transfer<>0 Then
;I never see this message
DebugLog "yeah"
EndIf
EndIf

Of course I use the right password and username, I only want to hide it from you. I think you understand ;-)
I also tried a code from the code-archive - with the same result...

Please help me or give advice how to solve the problem,

Christoph.


jfk EO-11110(Posted 2007) [#2]
What server is it? This could be an apache bug:
http://osdir.com/ml/jakarta.ftpserver.devel/2006-11/msg00027.html


no nickname(Posted 2007) [#3]
Thank you for answering.

The welcome message looks like

Welcome to the NEW EMIL with Debian 4.0,Apache 2.2.3,PHP5,MySQL5 and more!

I don't know all these Web-Programming applications very well. By the way it's not my server. I'll ask the owner. At the moment I think you are right. Because with another server (freenet) it works.

Christoph.