Skip to content
Davit Barbakadze edited this page Sep 8, 2013 · 15 revisions

Table of Contents

## Properties ### [VERSION](/moxiecode/plupload/blob/master/src/plupload.js#L78 "Defined at: src/plupload.js:78") `static`

Plupload version will be replaced on build.

### [STOPPED](/moxiecode/plupload/blob/master/src/plupload.js#L88 "Defined at: src/plupload.js:88") `static`

Inital state of the queue and also the state ones it's finished all it's uploads.

### [STARTED](/moxiecode/plupload/blob/master/src/plupload.js#L97 "Defined at: src/plupload.js:97") `static`

Upload process is running

### [QUEUED](/moxiecode/plupload/blob/master/src/plupload.js#L106 "Defined at: src/plupload.js:106") `static`

File is queued for upload

### [UPLOADING](/moxiecode/plupload/blob/master/src/plupload.js#L115 "Defined at: src/plupload.js:115") `static`

File is being uploaded

### [FAILED](/moxiecode/plupload/blob/master/src/plupload.js#L124 "Defined at: src/plupload.js:124") `static`

File has failed to be uploaded

### [DONE](/moxiecode/plupload/blob/master/src/plupload.js#L133 "Defined at: src/plupload.js:133") `static`

File has been uploaded successfully

### [GENERIC_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L144 "Defined at: src/plupload.js:144") `static`

Generic error for example if an exception is thrown inside Silverlight.

### [HTTP_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L153 "Defined at: src/plupload.js:153") `static`

HTTP transport error. For example if the server produces a HTTP status other than 200.

### [IO_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L162 "Defined at: src/plupload.js:162") `static`

Generic I/O error. For exampe if it wasn't possible to open the file stream on local machine.

### [SECURITY_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L171 "Defined at: src/plupload.js:171") `static`

Generic I/O error. For exampe if it wasn't possible to open the file stream on local machine.

### [INIT_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L180 "Defined at: src/plupload.js:180") `static`

Initialization error. Will be triggered if no runtime was initialized.

### [FILE_SIZE_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L189 "Defined at: src/plupload.js:189") `static`

File size error. If the user selects a file that is too large it will be blocked and an error of this type will be triggered.

### [FILE_EXTENSION_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L198 "Defined at: src/plupload.js:198") `static`

File extension error. If the user selects a file that isn't valid according to the filters setting.

### [FILE_DUPLICATE_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L207 "Defined at: src/plupload.js:207") `static`

Duplicate file error. If prevent_duplicates is set to true and user selects the same file again.

### [IMAGE_FORMAT_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L216 "Defined at: src/plupload.js:216") `static`

Runtime will try to detect if image is proper one. Otherwise will throw this error.

### [IMAGE_MEMORY_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L225 "Defined at: src/plupload.js:225") `static`

While working on the image runtime will try to detect if the operation may potentially run out of memeory and will throw this error.

### [IMAGE_DIMENSIONS_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L234 "Defined at: src/plupload.js:234") `static`

Each runtime has an upper limit on a dimension of the image it can handle. If bigger, will throw this error.

### [mimeTypes](/moxiecode/plupload/blob/master/src/plupload.js#L243 "Defined at: src/plupload.js:243")

Mime type lookup table.

## Methods ### [typeOf(o)](/moxiecode/plupload/blob/master/src/plupload.js#L257 "Defined at: src/plupload.js:257") `static`

Gets the true type of the built-in object (better version of typeof).

Arguments

  • o Object
    Object to check.
### [extend(target, obj)](/moxiecode/plupload/blob/master/src/plupload.js#L268 "Defined at: src/plupload.js:268") `static`

Extends the specified object with another object.

Arguments

  • target Object
    Object to extend.
  • obj Object..
    Multiple objects to extend with.
### [guid()](/moxiecode/plupload/blob/master/src/plupload.js#L279 "Defined at: src/plupload.js:279") `static`

Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers. The only way a user would be able to get the same ID is if the two persons at the same exact milisecond manages to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique. It's more probable for the earth to be hit with an ansteriod. You can also if you want to be 100% sure set the plupload.guidPrefix property to an user unique key.

### [each(obj, callback)](/moxiecode/plupload/blob/master/src/plupload.js#L292 "Defined at: src/plupload.js:292") `static`

Executes the callback function for each item in array/object. If you return false in the callback it will break the loop.

Arguments

  • obj Object
    Object to iterate.
  • callback Function
    Callback function to execute for each item.
### [getPos(node, root)](/moxiecode/plupload/blob/master/src/plupload.js#L303 "Defined at: src/plupload.js:303") `static`

Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields.

Arguments

  • node Element
    HTML element or element id to get x, y position from.
  • root Element
    Optional root element to stop calculations at.
### [getSize(node)](/moxiecode/plupload/blob/master/src/plupload.js#L314 "Defined at: src/plupload.js:314") `static`

Returns the size of the specified node in pixels.

Arguments

  • node Node
    Node to get the size of.
### [xmlEncode(s)](/moxiecode/plupload/blob/master/src/plupload.js#L324 "Defined at: src/plupload.js:324") `static`

Encodes the specified string.

Arguments

  • s String
    String to encode.
### [toArray(obj)](/moxiecode/plupload/blob/master/src/plupload.js#L340 "Defined at: src/plupload.js:340") `static`

Forces anything into an array.

Arguments

  • obj Object
    Object with length field.
### [inArray(needle, array)](/moxiecode/plupload/blob/master/src/plupload.js#L350 "Defined at: src/plupload.js:350") `static`

Find an element in array and return it's index if present, otherwise return -1.

Arguments

  • needle Mixed
    Element to find
  • array Array
### [addI18n(pack)](/moxiecode/plupload/blob/master/src/plupload.js#L361 "Defined at: src/plupload.js:361") `static`

Extends the language pack object with new items.

Arguments

  • pack Object
    Language pack items to add.
### [translate(str)](/moxiecode/plupload/blob/master/src/plupload.js#L371 "Defined at: src/plupload.js:371") `static`

Translates the specified string by checking for the english string in the language pack lookup.

Arguments

  • str String
    String to look for.
### [isEmptyObj(obj)](/moxiecode/plupload/blob/master/src/plupload.js#L381 "Defined at: src/plupload.js:381") `static`

Checks if object is empty.

Arguments

  • obj Object
    Object to check.
### [hasClass(obj, name)](/moxiecode/plupload/blob/master/src/plupload.js#L391 "Defined at: src/plupload.js:391") `static`

Checks if specified DOM element has specified class.

Arguments

  • obj Object
    DOM element like object to add handler to.
  • name String
    Class name
### [addClass(obj, name)](/moxiecode/plupload/blob/master/src/plupload.js#L401 "Defined at: src/plupload.js:401") `static`

Adds specified className to specified DOM element.

Arguments

  • obj Object
    DOM element like object to add handler to.
  • name String
    Class name
### [removeClass(obj, name)](/moxiecode/plupload/blob/master/src/plupload.js#L411 "Defined at: src/plupload.js:411") `static`

Removes specified className from specified DOM element.

Arguments

  • obj Object
    DOM element like object to add handler to.
  • name String
    Class name
### [getStyle(obj, name)](/moxiecode/plupload/blob/master/src/plupload.js#L421 "Defined at: src/plupload.js:421") `static`

Returns a given computed style of a DOM element.

Arguments

  • obj Object
    DOM element like object.
  • name String
    Style you want to get from the DOM element
### [addEvent(obj, name, callback, (optional))](/moxiecode/plupload/blob/master/src/plupload.js#L431 "Defined at: src/plupload.js:431") `static`

Adds an event handler to the specified object and store reference to the handler in objects internal Plupload registry (@see removeEvent).

Arguments

  • obj Object
    DOM element like object to add handler to.
  • name String
    Name to add event listener to.
  • callback Function
    Function to call when event occurs.
  • (optional) String
    key that might be used to add specifity to the event record.
### [removeEvent(obj, name, (optional))](/moxiecode/plupload/blob/master/src/plupload.js#L444 "Defined at: src/plupload.js:444") `static`

Remove event handler from the specified object. If third argument (callback) is not specified remove all events with the specified name.

Arguments

  • obj Object
    DOM element to remove event listener(s) from.
  • name String
    Name of event listener to remove.
  • (optional) Function|String
    might be a callback or unique key to match.
### [removeAllEvents(obj, (optional))](/moxiecode/plupload/blob/master/src/plupload.js#L456 "Defined at: src/plupload.js:456") `static`

Remove all kind of events from the specified object

Arguments

  • obj Object
    DOM element to remove event listeners from.
  • (optional) String
    unique key to match, when removing events.
### [cleanName(s)](/moxiecode/plupload/blob/master/src/plupload.js#L466 "Defined at: src/plupload.js:466") `static`

Cleans the specified name from national characters (diacritics). The result will be a name with only a-z, 0-9 and _.

Arguments

  • s String
    String to clean up.
### [buildUrl(url, items)](/moxiecode/plupload/blob/master/src/plupload.js#L501 "Defined at: src/plupload.js:501") `static`

Builds a full url out of a base URL and an object with items to append as query string items.

Arguments

  • url String
    Base URL to append query string items to.
  • items Object
    Name/value object to serialize as a querystring.
### [formatSize(size)](/moxiecode/plupload/blob/master/src/plupload.js#L524 "Defined at: src/plupload.js:524") `static`

Formats the specified number as a size string for example 1024 becomes 1 KB.

Arguments

  • size Number
    Size to format as string.
### [parseSize(size)](/moxiecode/plupload/blob/master/src/plupload.js#L561 "Defined at: src/plupload.js:561") `static`

Parses the specified size string into a byte value. For example 10kb becomes 10240.

Arguments

  • size String|Number
    String to parse or number to just pass through.
### [predictRuntime(config, [runtimes])](/moxiecode/plupload/blob/master/src/plupload.js#L572 "Defined at: src/plupload.js:572") `static`

A way to predict what runtime will be choosen in the current environment with the specified settings.

Arguments

  • config Object|String
    Plupload settings to check
  • [runtimes] String
    Comma-separated list of runtimes to check against
### [addFileFilter(name, cb)](/moxiecode/plupload/blob/master/src/plupload.js#L593 "Defined at: src/plupload.js:593") `static`

Registers a filter that will be executed for each file added to the queue. If callback returns false, file will not be added.

Callback receives two arguments: a value for the filter as it was specified in settings.filters and a file to be filtered. Callback is executed in the context of uploader instance.

Arguments

  • name String
    Name of the filter by which it can be referenced in settings.filters
  • cb String
    Callback - the actual routine that every added file must pass