-
Notifications
You must be signed in to change notification settings - Fork 1.4k
pluploadQueue
Davit Barbakadze edited this page Feb 2, 2017
·
7 revisions
Important! This page is auto-generated from the comments in the source files. All changes will be overwritten! If you are looking to contribute, modify the comment in the corresponding source file instead.
### [pluploadQueue(settings)](/moxiecode/plupload/blob/master/src\jquery.plupload.queue\jquery.plupload.queue.js#L13 "Defined at: src\jquery.plupload.queue\jquery.plupload.queue.js:13")jQuery based implementation of the Plupload API - multi-runtime file uploading API.
To use the widget you must include jQuery. It is not meant to be extended in any way and is provided to be used as it is.
Arguments
-
settings
Object
For detailed information about each option check documentation. -
url
String
URL of the server-side upload handler. -
[chunk_size=0]
Number|String
Chunk size in bytes to slice the file into. Shorcuts with b, kb, mb, gb, tb suffixes also supported.e.g. 204800 or "204800b" or "200kb"
. By default - disabled. -
[file_data_name="file"]
String
Name for the file field in Multipart formated message. -
[filters=[]
Array
Set of file type filters, each one defined by hash of title and extensions.e.g. {title : "Image files", extensions : "jpg,jpeg,gif,png"}
. Dispatchesplupload.FILE_EXTENSION_ERROR
-
[flash_swf_url]
String
URL of the Flash swf. -
[headers]
Object
Custom headers to send with the upload. Hash of name/value pairs. -
[max_file_size]
Number|String
Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes.e.g. "10mb" or "1gb"
. By default - not set. Dispatchesplupload.FILE_SIZE_ERROR
. -
[max_retries=0]
Number
How many times to retry the chunk or file, before triggering Error event. -
[multipart=true]
Boolean
Whether to send file and additional parameters as Multipart formated message. -
[multipart_params]
Object
Hash of key/value pairs to send with every file upload. -
[multi_selection=true]
Boolean
Enable ability to select multiple files at once in file dialog. -
[prevent_duplicates=false]
Boolean
Do not let duplicates into the queue. Dispatchesplupload.FILE_DUPLICATE_ERROR
. -
[required_features]
String|Object
Either comma-separated list or hash of required features that chosen runtime should absolutely possess. -
[resize]
Object
Enable resizng of images on client-side. Applies toimage/jpeg
andimage/png
only.e.g. {width : 200, height : 200, quality : 90, crop: true}
-
[width]
Number
If image is bigger, it will be resized. -
[height]
Number
If image is bigger, it will be resized. -
[quality=90]
Number
Compression quality for jpegs (1-100). -
[crop=false]
Boolean
Whether to crop images to exact dimensions. By default they will be resized proportionally. -
[runtimes="html5,flash,silverlight,html4"]
String
Comma separated list of runtimes, that Plupload will try in turn, moving to the next if previous fails. -
[silverlight_xap_url]
String
URL of the Silverlight xap. -
[unique_names=false]
Boolean
If true will generate unique filenames for uploaded files. -
[dragdrop=true]
Boolean
Enable ability to add file to the queue by drag'n'dropping them from the desktop. -
[rename=false]
Boolean
Enable ability to rename files in the queue. -
[multiple_queues=true]
Boolean
Re-activate the widget after each upload procedure.
Example
<!-- Instantiating: -->
<div id="uploader">
<p>Your browser doesn't have Flash, Silverlight or HTML5 support.</p>
</div>
<script>
$('#uploader').pluploadQueue({
url : '../upload.php',
filters : [
{title : "Image files", extensions : "jpg,gif,png"}
],
rename: true,
flash_swf_url : '../../js/Moxie.swf',
silverlight_xap_url : '../../js/Moxie.xap',
});
</script>
// Retrieving a reference to plupload.Uploader object
var uploader = $('#uploader').pluploadQueue();
uploader.bind('FilesAdded', function() {
// Autostart
setTimeout(uploader.start, 1); // "detach" from the main thread
});