1. Introduction of header Files (jquery in front, and cannot have multiple jquery)
<script type= "Text/javascript" src= "js/jquery-1.6.2.js" ></script> <link rel= "stylesheet" type= "text/ CSS "href=" js/uploadify/uploadify.css "> <script type=" text/javascript "src=" js/uploadify/ Jquery.uploadify.min.js "></script> Other events can be queried online API address: http://www.uploadify.com/documentation/
2. Upload button<body> <input type= "file" Name= "FileName" id= "File_upload"/> <a href= "javascript:$ (' #file_ Upload '). Uploadify (' upload ', ' * ') ' > upload file </a> | <a href= "javascript:$ (' #file_upload '). Uploadify (' Stop ') > Stop uploading!</a> </body>
3. Background processing@RequestMapping (value = "/uploadfile.do", method = requestmethod.post) public String uploadfile (@RequestParam (value = " File ", required = false) Multipartfile File,httpservletresponse response) throws IOException {//system.out.println ( File.getoriginalfilename ()); SYSTEM.OUT.PRINTLN ("Success! "); String message = "test test"; Response.setcharacterencoding ("UTF-8"); Response.getwriter (). Write ("{\" message\ ": \" "+ Message + "\"} "); Response.getwriter (). Flush (); return" Jsp/index ";}
Download/Documentation:uploadify official website:http://www.uploadify.com/
Uploadify Download: http://download.csdn.net/detail/leixiaohua1020/6376463
Demo: Link: http://pan.baidu.com/s/1jGsv4Gm Password: gcw4Jar: Link: http://pan.baidu.com/s/1AmNgU Password: 8qn9
Manual: Link: http://pan.baidu.com/s/1pJBikCr Password: or37
JQuery Uploadify3.2 + springmvc File upload