JQuery plugin AjaxFileUpload implements ajax file upload and jqueryajax upload plugin

Source: Internet
Author: User

JQuery plugin AjaxFileUpload implements ajax file upload and jqueryajax upload plugin

This article provides examples to share with you the specific code of AjaxFileUpload for file upload. The specific content is as follows:

The jQuery plug-in AjaxFileUpload is used to upload ajax files. This plug-in is very simple to use. Next I will write a demo to demonstrate how to use the AjaxFileUpload plug-in to upload files.

1. Introduce js related to the AjaxFileUpload plug-in

Copy codeThe Code is 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: The test shows that ajaxfileupload has requirements for the jQuery version. in use, ajaxfileupload must be consistent with the js version corresponding to jQuery. Otherwise, an exception may occur. You can download it from the official website of ajaxfileupload, avoid version conflicts.

2. Code for implementing the upload function

<% @ Page language = "java" import = "java. util. * "pageEncoding =" UTF-8 "%> <% @ include file ="/base. jsp "%> <% String 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 all the content of this article, and I hope it will help you learn jquery programming.

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.