Using Java's own class java.util.zip for file/directory compression, there is a lack of support for Chinese name/directory naming, if there is a Chinese name, then packaging will fail. I after a period of exploration and practice, found in the General Ant.jar Class Library also has a zip class, import org.apache.tools.zip.*, can solve the problem that does not support the Chinese file directory, at the same time, ant access to more ways, The general application server has this package, it is rea
Zhang Xiaoxiang: Java Complete FTP download address: [100% can download]
(There are more than 13G)
Http://www.whitehouse.net.cn/java
Other than that
The latest Vista systems are also available for download:
Http://www.whitehous
breakpoint download function, we need to mark the location of each thread's real-time download, so that we can continue to download the progress before the next start.Open 3 Threads Download view (default download directory is Java
Java Web file download 1-File Download implementation and garbled Processing
File upload and download are common problems in web development. In the past few days, I have used file downloads for a project. I have also separated some notes and made some preparations today. File Upload is pending for further testing. Her
In the previous section, we learned the basic principles and usage of multi-threaded download in java. We didn't talk about multithreaded resumable upload, next we will talk about resumable data transfer in this section. The importance of resumable data transfer is self-evident. You can save time without having to download it again, the key to resumable
Java web response provides the file download function, response File Download
The structure of a webapp project is as follows:
The content of the download.html file is as follows:
The content of the Servlet-download. java file responsible for processing the
10 useful results in Web development [Source Code download] and java web source code download10 useful results in Web development [Source Code download]
In our work, we may use various interactive effects. However, these effects often occur when I read articles, but I cannot remember where I am at half past one, so it is necessary to develop the habit of organizi
[Reprinted] 10 useful results in Web development [Source Code download] and Java Web source code download
In our work, we may use various interactive effects. However, these effects often occur when I read articles, but I cannot remember where I am at half past one, so it is necessary to develop the habit of organizing knowledge. This article recommends 10WebUsef
encodeURI mentioned above can be resolved.(2) file name garbled during client download executionIn the actual test, it is found that in the case of other browsers can be executed, the Chinese file name under IE may appear garbled. On the internet to see such a piece of code, tested, the perfect solution to the different browsers of Chinese garbled problem/* * Solve the Chinese garbled problem of each browser */string useragent = Request.getheader ("u
type, also can not write, write to specify the download file format, do not write, what file format, download is what format, according to project needs.
suffix-name MIME name*.3GPP AUDIO/3GPP, VIDEO/3GPP*.AC3 AUDIO/AC3*.ASF allpication/vnd.ms-asf*.au Audio/basic*.css Text/css*.csv Text/csv*.doc Application/msword*.dot Application/msword*.DTD APPLICATION/XML-DTD*.DWG IMAGE/VND.DWG*.DXF IMAGE/VND.DXF*.g
://javadoc.allimant.org/dist/jdk150.zipJDK 6:JDK6 API download: https://jdk-api-zh-cn.dev.java.net/JDK6 API Chinese Version HTML format online documentation: http://download.java.net/jdk/jdk-api-localizations/jdk-api-zh-cn/builds/latest/html/zh_CN/api/JDK6 API Chinese Version zip format download: http://download.java.net/jdk/jdk-api-localizations/jdk-api-zh-cn/bu
Java web upload/download garbled problem solution: web upload/download
Chinese characters of file downloading are garbled, because the http request url and header must only pass the ascii code, but not other characters. transcoding is required. Different browsers have different processing methods on the right.
Solution 1:
/*** Garbled solution * @ throws Unsup
Malformedurlexception { //download network file int bytesum = 0;4. Support for Online open mode public void DownLoad (String filePath, HttpServletResponse response, Boolean isOnLine) throws Exception {File F = New File (FilePath); if (!f.exists ()) {Response.senderror (404, "File not found!"); Return } bufferedinputstream br = new Bufferedinputstream (new File
org.apache.tools.zip.ZipOutputStream*/public static void ZipFile (File inputfile,zipoutputstream ouputstream) {try {if (inputfile.exists ()) {/** if it is a directory, here is not to take action,* As for the packaging of the catalogue is under study */if (Inputfile.isfile ()) {FileInputStream in = new FileInputStream (inputfile);Bufferedinputstream bins = new Bufferedinputstream (in, 512);Org.apache.tools.zip.ZipEntryZipEntry entry = new ZipEntry (Inputfile.getname ());Ouputstream.putnextentry
the recording process must all 3 processes download complete before you can deletemultidownload.finishedthread++; synchronized(Multidownload.path) {//thread security issues, static variables are unique if(Multidownload.finishedthread = =Multidownload.threadcount) { for(inti = 0; i ) {File F=NewFile (i + ". txt"); F.delete (); } multidownload.finishedthread= 0; } }
=Newftpclient (); Try { intreply; Ftp.connect (URL, port); //If you use the default port, you can connect directly to the FTP server using Ftp.connect (URL)Ftp.login (username, password);//LoginReply =Ftp.getreplycode (); if(!ftpreply.ispositivecompletion (Reply)) {Ftp.disconnect (); return false; } ftp.changeworkingdirectory (RemotePath);//Transfer to FTP server directoryftpfile[] fs =Ftp.listfiles (); Booleanftpfileexist=false; for(Ftpfile ff:fs) {String ffname=NewStr
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.