This plug-in is compatible with IE8 and above, implements the basic function, the bottom has the download connection
The code is as follows:
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en"
"Http://www.w3.org/TR/html4/loose.dtd" >
<title>uploadify multi-File upload plugin use </title>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<script type= "Text/javascript" src= "Js/jquery-1.8.2.js" ></script>
<link rel= "stylesheet" type= "Text/css" href= "Js/uploadfiy/uploadify.css"/>
<style type= "Text/css" >
#fileQueue {
Background_color: #FFF;
border_radius:3px;
/* box-shadow:0 1px 3px rgba (0, 0, 0, 0.25); */
border:1px solid #95B8E7;
/* box-shadow:0 1px 3px rgba (135, 175, 255, 1); */
height:220px;
margin-bottom:10px;
Overflow:auto;
/* padding:5px 10px; */
width:395px;
}
</style>
<!--This JS is modified to be compatible with IE8 and above versions--
<script type= "Text/javascript" src= "Js/uploadfiy/jquery.uploadify.js" ></script>
<script type= "Text/javascript" >
$ (document). Ready (function () {
Initfile ();
});
function Initfile () {
$ ("#uploadify"). Uploadify ({
' Uploader ': ' Fileuploadservlet ',//Background processing page
' swf ': './js/uploadfiy/uploadify.swf ',
' Script ': ',
' Width ': 80,
' Height ': 23,
' Folder ': '. /upload ',
' ButtonText ': ' Select File ',
' Fileext ': ' * * ',//allow uploading of file formats
' Queueid ': ' Filequeue ',
' Auto ': false,//need to submit the request manually
' Simuploadlimit ': 3,//number of simultaneous runs of uploaded processes
' Queuesizelimit ': 10,//
' Multi ': true
' Scriptdata ': {' dept ': ' Dept1 ', ' Group ': ' Group1 '},//This parameter must be set to method for GET,
' method ': ' Get '//Background with Request.getparameter (' name ') to get the value of the name
});
}
User Cancel function
function Funcancel (event, ID, Fileobj, data) {
Alert (' You have canceled ' + fileobj.name + ' operation ', ' info ');
Return
}
Events that occur when a picture is uploaded
function Funcomplete (event, ID, Fileobj, response, data) {
$ ("#pic"). html (' ');
if (response = = 0) {
Jbox.tip (' picture ' + fileobj.name + ' operation failed ', ' info ');
Return
}
$ ("#pic"). attr ("src", ".. /upload/"+ response). Height (+). Width (300);
Jbox.tip (' picture ' + fileobj.name + ' operation succeeded ', ' info ');
Return
}
When the upload error occurs.
function Funerror (event, ID, Fileobj, errorobj) {
Jbox.tip (Errorobj.info);
Return
}
</script>
<body style= "Background-color:white;" >
<div id= "Maindiv" style= "margin:0 auto;width:100%; text-align:center;border:1px solid #95b8e7; Background-color: #F3F3F3; " >
<div id= "filecollection" style= "width:420px;margin:0 auto;text-align:left; margin-top:30px;margin-bottom:50px; " >
<input type= "File" Name= "uploadify" id= "Uploadify"/>
<div id= "Filequeue" ></div>
<p style= "FONT-SIZE:12PX;" >
<a href= "javascript:$ (' #uploadify '). Uploadify (' upload ', ' * ') ' > Upload </a>| <a
href= "javascript:$ (' #uploadify '). Uploadify (' Cancel ', ' * ') ' > Cancel upload </a>
</p>
</div>
</div>
</body>