+1 vote

Hi
I am testing your tool for our company
need to connect to a server which supports active mode only
having difficulties to connect even if I am using

    Limilabs.FTP.Log.Enabled = True
    f.Mode = FTP.Client.FtpMode.Active
    f.DontUseCompression = True

    f.TransfersDataType = FTP.Client.FtpDataType.Ascii
    f.Connect(ftpserver)
    f.Login(ftpuser, ftppassword)

Connecting via Filzezilla is fine
using FTP protocoll :21
encryption: only use plain FTP
What the hell I am doing wrong ?

Sven

by
Please don't set the TransfersDataType - most likely it's not needed.

What error/exception are you getting?

1 Answer

0 votes

Consider using passive mode - it's much more common:

' f.Mode = FTP.Client.FtpMode.Passive (default)

f.Connect(ftpserver)
f.Login(ftpuser, ftppassword)
by (301k points)
I'll definitely buy this now!

Thanks for your support, have a good weekend and thx for the great and helpful discussion
Hi,
unfortunately I found same issue again with Active
If u need user & password for testing let me know

Start --------------- 52.174.59.196 TEST Server Azure Cloud
Active mode 52.174.59.196 TEST Server Azure Cloud
Ftp.dll Information: 0 :  8 09:53:46 Connecting to '52.174.59.196:21', SSL: False.
Ftp.dll Information: 0 :  8 09:53:46 Control connection uses port: 58294 (227,182)
Ftp.dll Information: 0 :  8 09:53:46 S: 220-Microsoft FTP Service
Ftp.dll Information: 0 :  8 09:53:46 S: 220 Svenni FTP
Ftp.dll Information: 0 :  8 09:53:46 C: USER *****
Ftp.dll Information: 0 :  8 09:53:46 S: 331 Password required
Ftp.dll Information: 0 :  8 09:53:46 C: PASS ****
Ftp.dll Information: 0 :  8 09:53:46 S: 230-Welcome by Svenni FTP
Ftp.dll Information: 0 :  8 09:53:46 S: 230 User logged in.
Ftp.dll Information: 0 :  8 09:53:46 C: FEAT
Ftp.dll Information: 0 :  8 09:53:46 S: 211-Extended features supported:
Ftp.dll Information: 0 :  8 09:53:46 S:  LANG EN*
Ftp.dll Information: 0 :  8 09:53:46 S:  UTF8
Ftp.dll Information: 0 :  8 09:53:46 S:  AUTH TLS;TLS-C;SSL;TLS-P;
Ftp.dll Information: 0 :  8 09:53:46 S:  PBSZ
Ftp.dll Information: 0 :  8 09:53:46 S:  PROT C;P;
Ftp.dll Information: 0 :  8 09:53:46 S:  CCC
Ftp.dll Information: 0 :  8 09:53:46 S:  HOST
Ftp.dll Information: 0 :  8 09:53:46 S:  SIZE
Ftp.dll Information: 0 :  8 09:53:46 S:  MDTM
Ftp.dll Information: 0 :  8 09:53:46 S:  REST STREAM
Ftp.dll Information: 0 :  8 09:53:46 S: 211 END
Ftp.dll Information: 0 :  8 09:53:46 C: OPTS UTF8 ON
Ftp.dll Information: 0 :  8 09:53:46 S: 200 OPTS UTF8 command successful - UTF8 encoding now ON.
Ftp.dll Information: 0 :  8 09:53:46 C: TYPE A
Ftp.dll Information: 0 :  8 09:53:46 S: 200 Type set to A.
Ftp.dll Information: 0 :  8 09:53:46 Binding to: 10.218.6.48:0
Ftp.dll Information: 0 :  8 09:53:46 Bound to: 10.218.6.48:0
Ftp.dll Information: 0 :  8 09:53:46 C: PORT 10,218,6,48,227,183
Ftp.dll Information: 0 :  8 09:53:46 S: 200 PORT command successful.
Ftp.dll Information: 0 :  8 09:53:46 C: LIST
Ftp.dll Information: 0 :  8 09:53:46 S: 150 Opening ASCII mode data connection.
Ftp.dll Information: 0 :  8 09:54:16 Limilabs.FTP.Client.FtpException: Remote server has not initiated the connection to '10.218.6.48:58295'.
   at   . ()
   at   .GetSocket()
   at   .  (Action`1 action)
   at   . ​(Stream local)
   at Limilabs.FTP.Client.Ftp.<>c__DisplayClass112_0.<SendDownloadCommand>b__0()
   at Limilabs.FTP.Client.Ftp.  (    action)
Ftp.dll Information: 0 :  8 09:54:16 S: 550
Exception thrown: 'Limilabs.FTP.Client.FtpResponseException' in Ftp.dll
 52.174.59.196
Ftp.dll Information: 0 :  8 09:54:16 C: QUIT
Ftp.dll Information: 0 :  8 09:54:17 S: 221 Bye
------------------------
******************Fertig
this is the detailed log from FileZilla
Status:    Disconnected from server
Status:    Connecting to 52.174.59.196:21...
Status:    Connection established, waiting for welcome message...
Response:    220-Microsoft FTP Service
Response:    220 Svenni FTP
Command:    USER FTPUser
Response:    331 Password required
Command:    PASS ********
Response:    230-Welcome by Svenni FTP
Response:    230 User logged in.
Command:    OPTS UTF8 ON
Response:    200 OPTS UTF8 command successful - UTF8 encoding now ON.
Status:    Logged in
Status:    Retrieving directory listing...
Command:    PWD
Response:    257 "/" is current directory.
Status:    Directory listing of "/" successful
Please send us credentials via email.

The error says that the FTP server hasn't connected to your client machine for active mode data transfer.
...