<% @ Page Language = "Java" contenttype = "text/html; charset = UTF-8"
Pageencoding = "UTF-8" %>
<% @ Page import = "Java. Io. *, java.util.zip. *" %>
<! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
<Title> insert title here </title>
</Head>
<Body>
<%
Out. println (application. getrealpath ("/"));
%>
<Br/>
<%
Try {
Zipinputstream in = new zipinputstream (New fileinputstream (
Application. getrealpath ("/") + "1.zip "));
Zipentry entry = NULL;
While (Entry = in. getnextentry ())! = NULL ){
String entryname = entry. getname ();
If (entry. isdirectory ()){
File file = new file (application. getrealpath ("/") + entryname );
File. mkdirs ();
System. Out. println ("create folder" + entryname );
} Else {
Fileoutputstream OS = new fileoutputstream (application. getrealpath ("/")
+ Entryname );
// Transfer bytes from the ZIP file to the output file
Byte [] Buf = new byte [1, 1024];
Int Len;
While (LEN = in. Read (BUF)> 0 ){
OS. Write (BUF, 0, Len );
}
OS. Close ();
In. closeentry ();
}
}
} Catch (ioexception e ){
}
Out. println ("decompressed file succeeded ");
%>
</Body>
</Html>