Skip to content
Davit Barbakadze edited this page Jun 4, 2013 · 15 revisions

Table of Contents

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

Plupload version will be replaced on build.

### [STOPPED](/moxiecode/plupload/blob/master/src/plupload.js#L78 "Defined at: src/plupload.js:78") `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#L87 "Defined at: src/plupload.js:87") `static`

Upload process is running

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

File is queued for upload

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

File is being uploaded

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

File has failed to be uploaded

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

File has been uploaded successfully

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

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

### [HTTP_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L143 "Defined at: src/plupload.js:143") `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#L152 "Defined at: src/plupload.js:152") `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#L161 "Defined at: src/plupload.js:161") `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#L170 "Defined at: src/plupload.js:170") `static`

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

### [FILE_SIZE_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L179 "Defined at: src/plupload.js:179") `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#L188 "Defined at: src/plupload.js:188") `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#L197 "Defined at: src/plupload.js:197") `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#L206 "Defined at: src/plupload.js:206") `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#L215 "Defined at: src/plupload.js:215") `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#L224 "Defined at: src/plupload.js:224") `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#L233 "Defined at: src/plupload.js:233")

Mime type lookup table.

## Methods ### [typeOf(o)](/moxiecode/plupload/blob/master/src/plupload.js#L247 "Defined at: src/plupload.js:247") `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#L258 "Defined at: src/plupload.js:258") `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#L269 "Defined at: src/plupload.js:269") `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#L282 "Defined at: src/plupload.js:282") `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#L293 "Defined at: src/plupload.js:293") `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#L304 "Defined at: src/plupload.js:304") `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#L314 "Defined at: src/plupload.js:314") `static`

Encodes the specified string.

Arguments

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

Forces anything into an array.

Arguments

  • obj Object
    Object with length field.
### [inArray(needle, array)](/moxiecode/plupload/blob/master/src/plupload.js#L340 "Defined at: src/plupload.js:340") `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#L351 "Defined at: src/plupload.js:351") `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#L361 "Defined at: src/plupload.js:361") `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#L371 "Defined at: src/plupload.js:371") `static`

Checks if object is empty.

Arguments

  • obj Object
    Object to check.
### [hasClass(obj, name)](/moxiecode/plupload/blob/master/src/plupload.js#L381 "Defined at: src/plupload.js:381") `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#L391 "Defined at: src/plupload.js:391") `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#L401 "Defined at: src/plupload.js:401") `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#L411 "Defined at: src/plupload.js:411") `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#L421 "Defined at: src/plupload.js:421") `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#L434 "Defined at: src/plupload.js:434") `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#L446 "Defined at: src/plupload.js:446") `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#L456 "Defined at: src/plupload.js:456") `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#L491 "Defined at: src/plupload.js:491") `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#L514 "Defined at: src/plupload.js:514") `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#L551 "Defined at: src/plupload.js:551") `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(features)](/moxiecode/plupload/blob/master/src/plupload.js#L562 "Defined at: src/plupload.js:562") `static`

A way to predict what runtime will be choosen in the current environment with the specified settings or a list of features/caps.

Arguments

  • features Object|String
    List of settings/features/caps