You need the following configuration (including the introduction of the file) HTML:
<HTMLxmlns= "http://www.w3.org/1999/xhtml"><Headrunat= "Server"> <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /> <title></title> <Scriptsrc= "Js/jquery-1.8.3.js"></Script> <Scriptsrc= "Uploadify/jquery.uploadify.min.js"></Script> <Scriptsrc= "Uploadify/jquery.uploadify.js"></Script> <Linkhref= "Uploadify/uploadify.css"rel= "stylesheet" /></Head><Body> <formID= "Form1"runat= "Server"> <Scripttype= "Text/javascript"> $(function () { $('#file_upload'). uploadify ({'SWF': '/uploadify/uploadify.swf',//must be 'Uploader': 'uploadhandler.ashx',//processing the background address of the uploaded image 'cancelimg': 'Image/ico/uploadify-cancel.png',//Canceled Pictures 'Auto': false//set to False to disable automatic upload, default true //Put your options here }); }); </Script> <inputtype= "File"name= "File_upload"ID= "File_upload" /> <ahref= "javascript:$" (' #file_upload '). Uploadify (' upload ', ' swfupload_0_1 ') ">Upload</a>| <ahref= "javascript:$ (' #file_upload '). Uploadify (' Stop ', ' swfupload_0_3 ')">Cancel Upload</a> </form></Body></HTML>
Upload method is the upload method, the second parameter refers to the upload of one of the specified, fixed, only the back of 0-1 or 0-3 can change the representative of one, if more than one, need to separate the comma, such as:
Swfupload_0_1,swfupload_0_3
Background:
Public voidProcessRequest (HttpContext context) {context. Response.ContentType="Text/plain"; //context. Response.Write ("Hello World");httppostedfile File= Context. request.files["Filedata"]; stringUploadpath =HttpContext.Current.Server.MapPath ("\\word") +"\\"; if(File! =NULL) { if(!directory.exists (Uploadpath)) {directory.createdirectory (Uploadpath); } file. SaveAs (Uploadpath+file. FileName); //the operations that are stored in the database can be added here ... //If the following code is missing, the upload queue display will not disappear automatically after uploading successfully .Context. Response.Write ("1"); } Else{context. Response.Write ("0"); } }
Official API Address:
http://www.uploadify.com/documentation/
Chinese API Address:
Http://www.mamicode.com/info-detail-506696.html
Sample diagram:
Interested students can look at the official website
jquery's Uploadify plug-in implementation of bulk upload version V3.2.1