Use of the jquery upload plug-in (uploadify)

Source: Internet
Author: User

I haven't written a blog for a long time. Let's take a look at the time of today! No nonsense. Let's go

As a fan of jquery, jquery provides many plug-ins. I will introduce them today.

Create a WEB Project: updisfile

Add the uploadfile folder, and then add the subfolder upload under the uploadfile folder as the uploaded folder.

After adding the file, you can import the required jquery upload plug-in.

Add the required script to the default page. The script and style file to be introduced here should be carefully noted.

This is the script to be introduced. Please be careful when introducing it.

The following job is to compile the jquery loading script.

<SCRIPT type = "  Text/JavaScript  " > $ (Document). Ready (function () {$ (  "  # Uploadify  "  ). Uploadify ({  '  Uploader  ' : ' Uploadimg/uploadify.swf  ' , //  The relative path of the uploadify.swf file. The SWF file is a button with a text browse. After clicking it, it fades out and opens the file dialog box. Default Value: uploadify.swf              '  Script  ' : '  Uploadimg/ajax/uploadhandler. ashx  ' , //  General handling of uploadsProgram              '  Cancelimg  ' : '  Uploadimg/cancel.png  ' , //  Location of the canceled image folder              '  Folder  ' :"  Uploadfile/upload/  " , //  Upload folder location              '  Queueid  ' : '  Filequeue  ' , //  ID of the file queue, which is consistent with the ID of the DIV storing the file queue              '  Fileext  ' : '  *. Jpg; *. gif; *. PNG  ' , //  Set the type of the file to be selected.              '  Filedesc  ' : '  Image files (. jpg,. GIF,. PNG) ' , //  Types of files allowed to be uploaded              '  Buttontext  ' : '  Choose  ' , //  Select the file button value, which can be customized              '  Auto  ' : False , //  Set to true. When a file is selected, it is uploaded directly. If it is set to false, You need to click the upload button to upload the file.              '  Multi  ' : True  //  Sets whether multiple files can be uploaded. False indicates a single upload.  });}); </SCRIPT>

I have added comments and described them in the API.

Below is the htmlCode

<Div style = "  Width: 800px; Height: auto; margin: 0px auto;  " > <Div>  Upload images </H3> </div> <Div id = "  Filequeue  " > </Div> <input type = "  File  " Name = "  Uploadify  " Id = "  Uploadify  " /> <Input style = " Vertical-align: Top; Height: 30px; Background: #535353; color: white; Font-weight: bold; font-size: 13px; cursor: pointer; "  Type =  " Button "  Name =  " Uploadify " Onclick = "  Javascript: $ ('# uploadify'). uploadifyupload ()  " Value = "  Upload  " /> <Input style = "  Vertical-align: Top; Height: 30px; Background: #535353; color: white; Font-weight: bold; font-size: 13px; cursor: pointer; " Type =  " Button "  Name =  " Uploadify " Onclick = "  Javascript: $ ('# uploadify'). uploadifyclearqueue ()  " Value = "  Cancel upload  " /> </Div>

So much. Now you can run it.

I tested many browsers. We found that Google does not support the file type to be uploaded. I am wondering if you have encountered this problem.

This is the choice file of Google's browser, which is a bit confusing here.

Firefox is normal, and other browsers can.

Http://download.csdn.net/detail/mryanghenglian/4657375

 

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.