In the Java program development, FTP with a lot of, often dealing with, for example, upload files to ftp server, download files, this article to introduce how to use the Jakarta Commons in the FtpClient (in the Commons-net package) to achieve upload download files.
First, upload files
The principle is not introduced, we look at the code directly
/** * Desc
Java file downloads in several ways, as follows:
Public httpservletresponse Download (String path, httpservletresponse response) {try {//path is the path to the file you want to download.
File File = new file (path);
Gets the file name.
String filename = File.getname ();
Gets the suffix name of the file.
String ext = filenam
In Java programs, often need to deal with FTP, such as uploading files to the FTP server, download files, this article briefly describes how to use the FtpClient in Jakarta Commons (in the Commons-net package) to achieve upload download files. The jar packages used by are: commons-net-1.4.1.jar jakarta-oro.jar First, upload file
File Upload sou
In the development of Web application system, the file upload and download function is a very common function, today it is the implementation of the file download function in Javaweb.Direct Mapping and Code:1. List of files 2. Configure Downloadservlet in the Web. xml file servlet> Servlet-name>DownloadservletServlet-name> Servlet-class>Com.thinkplatform.controller.DownLoadServletServlet-clas
Export an Excel file from a Java Web project and a download box is displayed.Introduction
Reports are often involved in Java Web development. In a recent project, you need to display the data in the database as a table and export the data as an Excel file.Related jar packages
Using POI can solve the problem of Excel Import and Export. POI:Poi-3.6-20091214.jarKey
Multiple files are downloaded at the same time, but a single file does not have multi-thread downloads and does not have the resumable upload function. Continue to improve:
Package com. util. file; public class files {/***** get the applicationProgram* @ Return application root directory */public static string getsyspath () {return system. getproperty ("user. dir ");}}
Package COM. core. crawl; import Java. io. file; import
JAVA (WEB) Development tools download Web site [with the edge of creation]
I. Preferred
1.EclipseHttp://www.eclipse.org (http://www.eclipse.org/downloads/)
2.Eclipse Multi-Country Language pack:http://download.eclipse.org/downloads/
3.JDK:Http://java.sun.com (http://java.sun.com/javase/downloads/index.jsp)
@ Java EE Development:
1.Lomboz
Download Java API Chinese Version
Java API docs is one of the most frequently used references for learning and using the Java language. The complete Chinese version of Java API documentation contains 32 class libraries. However, this document is only available in English an
installations need to be based on the Eclipse installation directory and gradually release the full version of the development package later, with Eclipse, JDK and various plugins installedEclipse downloadDownload http://eclipse.org/Eclipse installationThe green version of the decompression can be used (Eclipse)Installation version double-click to run, all the way next (JDK)Since eclipse requires a Java-based environment, the post-installation runtim
programming thinking to manipulate the database at will. Hibernate can be applied to any JDBC application, both in Java client applications and in servlet/jsp Web applications, and most revolutionary of all, hibernate can replace CMP in the EE architecture of the EJB application. The task of achieving data persistence.Official website http://hibernate.org/orm/Tool Library:Log4jApache an open source project, by using log4j, we can control the destinat
Effective Java (Chinese second edition) "PDF" Download Link:https://u253469.pipipan.com/fs/253469-230382186Java (second edition) "PDF" "title=" "Effective Java (Chinese second edition)" PDF ""/>Editor's recommendation"Sun's core Technology series: EffectiveThe Chinese version of Java (2nd edition) has a comprehensive,
If you want to write a program in the Java language, you have to build a Java development environment, install the JDK, and then configure the environment variables.One: Download JDK, now the JDK mainstream is Sun's JDK, of course, IBM and some other commercial companies have developed their own JDK, improve programming efficiency, here we take Sun's JDK as an ex
If you want to write a program in the Java language, you have to build a Java development environment, install the JDK, and then configure the environment variables.One: Download jdkToday's JDK is the main mainstream of the Sun's JDK, of course, IBM and some other commercial companies have developed their own JDK, improve the efficiency of programming, here we ta
Need to use Java to write an FTP tool, because only a little Java foundation, but because a few years do not, almost is not, had to do a little bit, fortunately can pick up.
However, because of the use of Javac in Linux to compile, not in WIN under the IDE to do these things, so in the run and compile a little time, but it is because of some of the JAVA compiler
= "Test.zip";These files are all there, I'm dead, I can send names from the page.String[] Filepatharray = {"1.jpg", "2.jpg", "3.xls", "Test. docx"};String path = Getservletcontext (). Getrealpath ("/") + "\\image";Resp.setcontenttype ("Application/x-msdownload"); Notifies the client of the MIME type of the file:Resp.setheader ("Content-disposition", "attachment;filename=" + zipfilename);Zipoutputstream Zos = new Zipoutputstream (Resp.getoutputstream ());for (String Filepath:filepatharray) {File
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.