This example for you to share the Ajaxfileupload implementation of file upload specific code, for your reference, the specific content as follows
jquery plug-in Ajaxfileupload used to implement Ajax file upload, the plug-in is very simple to use, and then write a demo demo How to use the Ajaxfileupload plug-in implementation file upload.
1, the introduction of Ajaxfileupload Plug-ins related to JS
Copy Code code as follows:
<script type= "Text/javascript" src= "<%=basepath%>resources/js/jquery-1.2.1.js" ></script>
<script type= "Text/javascript" src= "<%=basepath%>resources/js/ajaxfileupload.js" ></script>
Note: Test found that ajaxfileupload on the jquery version is required, in the use of Ajaxfileupload and jquery corresponding JS version to be consistent, otherwise it will cause abnormal occurrence, can be downloaded from the Ajaxfileupload website, Avoid version conflicts.
2, to achieve the upload function code
<%@ page language= "java" import= "java.util.*" pageencoding= "UTF-8"%> <%@ include file= "/base.jsp"%> <% S
Tring Path = Request.getcontextpath ();
String basepath = request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/"; %> <! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
The above is the entire content of this article, I hope to learn from the jquery program to help.