Uploadify multi-File Upload plugin

Source: Internet
Author: User

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>
Code Download Connection: http://download.csdn.net/detail/zhzhjieke/8411193

Uploadify multi-File Upload plugin

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.