| Author |
Accessing FTP Server using Java
|
Chetan Parekh
Ranch Hand
Joined: Sep 16, 2004
Posts: 3636
|
|
Hello!, I downloaded following class from the net that allows to login in FTP Server. It was working fine, but when I added ls command (I have added comment see that) , it give error saying [i]500 'LS': command not understood.[i] How to solve this problem? Reg, Chetan
|
My blood is tested +ve for Java.
|
 |
Joe Ess
Bartender
Joined: Oct 29, 2001
Posts: 8259
|
|
FTP is a pretty loose protocol. Some servers implement features that others do not. Depending on your server, "LS" may not be supported:
5. DECLARATIVE SPECIFICATIONS 5.1. MINIMUM IMPLEMENTATION In order to make FTP workable without needless error messages, the following minimum implementation is required for all servers: TYPE - ASCII Non-print MODE - Stream STRUCTURE - File, Record COMMANDS - USER, QUIT, PORT, TYPE, MODE, STRU, for the default values RETR, STOR, NOOP. The default values for transfer parameters are: TYPE - ASCII Non-print MODE - Stream STRU - File All hosts must accept the above as the standard defaults.
RFC 959 - File Transfer Protocol As a matter of fact, I don't see "LS" at all in the RFC. Try using a command-line FTP client to log in. Typing in "help" may get you a list of valid commands for that server.
|
"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
|
 |
Arnold Reuser
Ranch Hand
Joined: Nov 20, 2003
Posts: 193
|
|
Maybe you could take also look at Commons Net for the base classes of FTP. Around these bases classes Julian Robichaux has already written a wrapper that make the usage of FTP within java a bit less hard. You can find his code over here : http://www.nsftools.com/tips/JakartaFtpWrapper.java
|
 |
Chetan Parekh
Ranch Hand
Joined: Sep 16, 2004
Posts: 3636
|
|
Thanks a lot!! I will implement this thing. Warm Regards, Chetan
|
 |
 |
|
|
subject: Accessing FTP Server using Java
|
|
|