Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Download FTP File with FTPClientExample.java
How to download a FTP file with examples.ftp.FTPClientExample.java program? I know the file path on the anonymous server.
✍: FYIcenter.com
If you know the file path on an anonymous FTP server,
you can use the following command to download the file from the FTP server:
java -a -A -b examples.ftp.FTPClientExample host path file Where: -a - Use active mode for data connections to avoid firewall settings -A - Use anonymous login -b - Use binary mode to download the file host - Host name or IP address of the FTP server path - Path name of the download file on the FTP server file - File name to save the downloaded file
Here is an example of running examples.ftp.FTPClientExample.java program to download the /apache.org/commons/net/source/commons-net-3.5-src.zip file from the apache.cs.utah.edu FTP server:
C:\fyicenter> java
-cp .;C:\local\commons-net-3.5\commons-net-3.5.jar
;C:\local\commons-net-3.5\commons-net-examples-3.5.jar
examples.ftp.FTPClientExample -a -A -b apache.cs.utah.edu
/apache.org/commons/net/source/commons-net-3.5-src.zip
commons-net-3.5-src.zip
220 Welcome to the UofU School of Computing FTP Mirror
Connected to apache.cs.utah.edu on 21
USER *******
331 Please specify the password.
PASS *******
230 Login successful.
SYST
215 UNIX Type: L8
Remote system is UNIX Type: L8
TYPE I
200 Switching to Binary mode.
PORT 192,168,1,7,239,1
200 PORT command successful. Consider using PASV.
RETR /apache.org/commons/net/source/commons-net-3.5-src.zip
150 Opening BINARY mode data connection for
/apache.org/commons/net/source/commons-net-3.5-src.zip (710625 bytes).
226 Transfer complete.
NOOP
200 NOOP ok.
QUIT
221 Goodbye.
⇒ What Is examples.telnet.WeatherTelnet.java
⇐ List FTP Directory with FTPClientExample.java
2017-05-05, ∼3130🔥, 0💬
Popular Posts:
How to download and install javamail-1_2.zip? The JavaMail API is a set of abstract APIs that model ...
JDK 11 jdk.internal.vm.compiler .jmodis the JMOD file for JDK 11 Internal VM Compiler module. JDK 11...
JDK 17 jdk.jdeps.jmod is the JMOD file for JDK 17 JDeps tool, which can be invoked by the "jdeps" co...
What Is poi-ooxml-5.2.3.jar? poi-ooxml-5.2.3.jar is one of the JAR files for Apache POI 5.2.3, which...
JDK 11 jdk.jconsole.jmod is the JMOD file for JDK 11 JConsole tool, which can be invoked by the "jco...