Plupload Upload Plugin Usage guide (ii) jquery

Source: Internet
Author: User
Tags unique id silverlight

The project used to change the upload plug-in, so smoked an evening event to look at the example and document, translation, if there is a wrong translation Please help me correct the thank you.

Introduced:

Plupload is developed by TINYMCE developers to provide a highly available upload plugin for your content management system or similar upload program. Plupload is currently divided into a core API and a jQuery upload Queue widget, so you can use it directly or customize it yourself.

Characteristics:

Note: 1,gears: http://zh.wikipedia.org/wiki/Gears

2, Silverlight:http://zh.wikipedia.org/wiki/silverlight

3,browserplus:http://developer.yahoo.com/browserplus/

Note:1, chunking : Chrome and Firefox 4+ support.

2, drag and drop for Firefox and webkit kernel browser,Windows version of the safari there are still some problems to be resolved.

3. Image scaling is supported only on firefox3.5+ and Chrome ,Safari/opera does not support direct data access to selected files.

4. Currently, all browsers do not support file type filtering. However, we fill in the HTML5 accept file Type Filter property and once there is support it will work.

5, multi-file upload only support Gecko and webkit kernel browser.

Configuration Document Description:

Browse_button: The unique ID of the button tag that triggers the browse file, where the source of the triggering event can be found in Flash, HTML5, and Silverlight (I understand that This parameter does not need to be see in the queue part )

Container: The container that displays the list of uploaded files, [Body by default]

Chunk_size: When the upload file is larger than the server receive side file size limit, you can send multiple requests to the server, if you do not need to remove from the settings

Drop_element: When the browser supports drag-and-drop, you can drag and drop files into the container ID you want.

File_data_name: Sets the name of the upload field. is set to file by default. (I tried not to find how to use it, not to mention)

Filters: Select filter for file extension, only title and ext two entries in each filter rule [{title: ', Extensions: '}]

Flash_swf_url:flash file Address

Headers: Custom key-value pairs for inserting HTTP requests

Max_file_size: Maximum upload file size (format 100b, 10kb, 10MB, 1GB)

Multipart: Boolean value that cannot be worked under WebKit if Mutlipart is substituted for binary stream

Multipart_params: Key-value pairs associated with multipart

Multi_selection: Multi-Select dialog box

Resize: Modify Picture Properties resize: {width:320, height:240, quality:90}

Runtimes: The Upload plugin initializes the order of precedence in that way, and if the first initialization fails, go to the second one, and so on.

Required_features: Requires those features to initialize the plugin

URL: Upload server address

Unique_names: Whether to generate a unique file name, to avoid duplicate server files

Urlstream_upload: boolean If flash upload should use Urlstream instead of Filereference.upload

properties of the jquery part:

DragDrop: Whether drag is supported, default value TRUE

Multiple_queues: Can I upload multiple times

PreInit: Pre-plugin initialization callback function

Rename: Boolean, can rename file before uploading, default false, Wood has found how to rename Ah

API Documentation:

List of methods:

Uploader (setting): How to create an instance

varuploader = newplupload.Uploader({    runtimes : ‘gears,html5,flash‘,    browse_button : ‘button_id‘});

Bind (event, function[, scope]): Bind event

uploader.bind(‘Init‘, function(up) {    alert(‘Supports drag/drop: ‘+ (!!up.features.dragdrop));});

Destroy (): Destroys an instance object of Plupload

uploader.destroy()

GetFile (ID): Get upload file information

uploader.bind(‘FilesAdded‘, function(up, files) {    for (var i in files) {        up.getFile(files[i].id);           }});<span style="color: #ff0000; font-size: 13px;"> </span>

Note: file:{
ID: File Number,
Loaded: How many bytes have been uploaded,
Name: File name,
Percent: Upload progress,
Size: File sizes,
Status: There are four states QUEUED, uploading, FAILED, done. corresponding values
}

Init: Initializing Plupload instances, adding listener objects

uploader.destroy()

Refresh: Re-instantiate uploader

RemoveFile (ID): Removal of a file from files

Splice (start,length): Deletes the length file from start of queue and returns the list of deleted files

Start () upload

Stop () stops uploading

Unbind (name, function): Contact Event Binding

Unbindall () Unbind all events

Property Collection:

Those features are included in the Features:uploader

Files: List of documents in the current queue

Unique ID of the Id:uploader instance

Runtime: Current operating Environment (HTML5, flash, etc.)

State: Current Upload progress status

Total: The collection of information for the current upload file

Event collection: (Up is uploader abbreviation)

Beforeupload (up, file): event triggered before file upload is complete

Chunkuploaded (up, file,response) file uploaded by Chunked event

Destroy (UP): Method of uploader Destroy call

Error (UP, err): triggered when an upload error occurs

fileadded (up, files): Triggered when the user selects a file

Fileremoved (up, files): Triggers when files are removed from the upload queue

fileuploaded (up, file, res): Trigger when file upload is successful

Init (UP): triggers when initializing

Postinit (UP): Event firing to be performed after Init finishes execution

Queuechanged (UP): triggered when file queue changes

Refresh (UP): triggers when silverlight/flash or other operating environments need to be moved

StateChanged (UP) triggers when the entire upload queue is changed

Uploadcomplete (up,file) triggers when all files in the queue are uploaded

UploadFile (up,file) triggers when a file is uploaded

Uploadprogress (up,file): triggered when the file is being uploaded

Reprint http://www.cnblogs.com/God-Shell/articles/3209708.html

Plupload Upload Plugin Usage guide (ii) jquery

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.