开发者

FTP error : 503 bad sequence of commands?

开发者 https://www.devze.com 2023-03-09 20:43 出处:网络
I am using FileZilla FTP Server windows edition. I wrote a java programe to connect to my FTP server, and send FTP raw commands to the server via socket.

I am using FileZilla FTP Server windows edition. I wrote a java programe to connect to my FTP server, and send FTP raw commands to the server via socket. when I send "LIST", I got 503 error :

(000002)2011/6/1 10:46:56 - (not logged in) (127.0.0.1)> Connected, sending welcome message...
(000002)2011/6/1 10:46:56 - (not logged in) (127.0.0.1)> 220-FileZilla Server version 0.9.37 beta
(000002)2011/6/1 10:46:56 - (not logged in) (127.0.0.1)> 220-written by Tim Kosse (Tim.Kosse@gmx.de)
(000002)2011/6/1 10:46:56 - (not logged in) (127.0.0.1)> 220 Please visit http://sourceforge.n开发者_JS百科et/projects/filezilla/
(000002)2011/6/1 10:46:56 - (not logged in) (127.0.0.1)> USER ggfan
(000002)2011/6/1 10:46:56 - (not logged in) (127.0.0.1)> 331 Password required for ggfan
(000002)2011/6/1 10:46:56 - (not logged in) (127.0.0.1)> PASS *****
(000002)2011/6/1 10:46:56 - ggfan (127.0.0.1)> 230 Logged on
(000002)2011/6/1 10:46:56 - ggfan (127.0.0.1)> LIST 
(000002)2011/6/1 10:46:56 - ggfan (127.0.0.1)> 503 Bad sequence of commands.
(000002)2011/6/1 10:46:56 - ggfan (127.0.0.1)> QUIT
(000002)2011/6/1 10:46:56 - ggfan (127.0.0.1)> 221 Goodbye

please help

best regards


I believe that in order to do a data transfer (and LIST is a data transfer command) you must issue a PORT command first to establish the data connection. The best way to figure this out is to either read the relevant spec, or (more fun) fire up Wireshark and see what actually happens using a working FTP client.

0

精彩评论

暂无评论...
验证码 换一张
取 消