Uploadify struts2 Implement image upload

Source: Internet
Author: User

uploadify is a good jquery upload plugin from abroad, the main function is to upload files in bulk, with progress display.

Includes two versions, one of which is flash and the other is HTML5. The following describes how the flash version is used


1. Download Uploadify Zip


2. Unzip the package and upload the following files to a folder on your website:

Jquery.uploadify.min.js

Uploadify.css

Uploadify-cancel.png

uploadify.swf


3. Do not forget to introduce the jquery library when you use the Uploadify page


4. Introduce the following file on the page

<script type= "Text/javascript" src= "uploadify/jquery-1.8.0.min.js" ></script><script type= "text/ JavaScript "src=" uploadify/jquery.uploadify.min.js "></script><link rel=" stylesheet "type=" Text/css " href= "Uploadify/uploadify.css" >

5. Add file input to the page

<input type= "File" Name= "File_upload" id= "File_upload"/>

6. Initialize Uploadify

$ (function () {    $ (' #file_upload '). Uploadify ({        ' swf '      : ' uploadify.swf ',        ' uploader ': ' Fileuploadaction.action '        //Put your options here    });

7. The final page should look like this

<%@ page language= "java" import= "java.util.*" pageencoding= "Utf-8"%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >

For more uploadify properties please refer to http://www.uploadify.com/documentation/


Process upload file action omitted, need to download source: Download


Effect


Itmyhome



Uploadify struts2 Implement image upload

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.