Skip to content
Davit Barbakadze edited this page Jan 11, 2013 · 21 revisions

Uploader

Defined at: src/plupload.js:451

undefined

Properties

Methods

Events

Properties

### id _Defined at: [src/plupload.js:764](/moxiecode/plupload/blob/master/src/plupload.js#L764)_

Unique id for the Uploader instance.


### state _Defined at: [src/plupload.js:772](/moxiecode/plupload/blob/master/src/plupload.js#L772)_

Current state of the total uploading progress. This one can either be plupload.STARTED or plupload.STOPPED. These states are controlled by the stop/start methods. The default value is STOPPED.


### features _Defined at: [src/plupload.js:782](/moxiecode/plupload/blob/master/src/plupload.js#L782)_

Map of features that are available for the uploader runtime. Features will be filled before the init event is called, these features can then be used to alter the UI for the end user. Some of the current features that might be in this map is: dragdrop, chunks, jpgresize, pngresize.


### files _Defined at: [src/plupload.js:792](/moxiecode/plupload/blob/master/src/plupload.js#L792)_

Current upload queue, an array of File instances.


### settings _Defined at: [src/plupload.js:801](/moxiecode/plupload/blob/master/src/plupload.js#L801)_

Object with name/value settings.


### total _Defined at: [src/plupload.js:809](/moxiecode/plupload/blob/master/src/plupload.js#L809)_

Total progess information. How many files has been uploaded, total percent etc.


Methods

### init _Defined at: [src/plupload.js:818](/moxiecode/plupload/blob/master/src/plupload.js#L818)_

Initializes the Uploader instance and adds internal event listeners.


### refresh _Defined at: [src/plupload.js:1144](/moxiecode/plupload/blob/master/src/plupload.js#L1144)_

Refreshes the upload instance by dispatching out a refresh event to all runtimes. This would for example reposition flash/silverlight shims on the page.


### start _Defined at: [src/plupload.js:1155](/moxiecode/plupload/blob/master/src/plupload.js#L1155)_

Starts uploading the queued files.


### stop _Defined at: [src/plupload.js:1169](/moxiecode/plupload/blob/master/src/plupload.js#L1169)_

Stops the upload of the queued files.


### disableBrowse(disable) _Defined at: [src/plupload.js:1182](/moxiecode/plupload/blob/master/src/plupload.js#L1182)_

Disables/enables browse button on request.

Arguments

  • disable (Boolean) Whether to disable or enable (default: true)

### getFile(id) _Defined at: [src/plupload.js:1198](/moxiecode/plupload/blob/master/src/plupload.js#L1198)_

Returns the specified file object by id.

Arguments

  • id (String) File id to look for.

### removeFile(file) _Defined at: [src/plupload.js:1215](/moxiecode/plupload/blob/master/src/plupload.js#L1215)_

Removes a specific file.

Arguments

  • file (plupload.File) File to remove from queue.

### splice(start, length) _Defined at: [src/plupload.js:1231](/moxiecode/plupload/blob/master/src/plupload.js#L1231)_

Removes part of the queue and returns the files removed. This will also trigger the FilesRemoved and QueueChanged events.

Arguments

  • start (Number) (Optional) Start index to remove from.
  • length (Number) (Optional) Lengh of items to remove.

### trigger(name, Multiple) _Defined at: [src/plupload.js:1251](/moxiecode/plupload/blob/master/src/plupload.js#L1251)_

Dispatches the specified event name and it's arguments to all listeners.

Arguments

  • name (String) Event name to fire.
  • Multiple (Object..) arguments to pass along to the listener functions.

### hasEventListener(name) _Defined at: [src/plupload.js:1281](/moxiecode/plupload/blob/master/src/plupload.js#L1281)_

Check whether uploader has any listeners to the specified event.

Arguments

  • name (String) Event name to check for.

### bind(name, func, scope) _Defined at: [src/plupload.js:1291](/moxiecode/plupload/blob/master/src/plupload.js#L1291)_

Adds an event listener by name.

Arguments

  • name (String) Event name to listen for.
  • func (Function) Function to call ones the event gets fired.
  • scope (Object) Optional scope to execute the specified function in.

### unbind(name, func) _Defined at: [src/plupload.js:1308](/moxiecode/plupload/blob/master/src/plupload.js#L1308)_

Removes the specified event listener.

Arguments

  • name (String) Name of event to remove.
  • func (Function) Function to remove from listener.

### unbindAll _Defined at: [src/plupload.js:1339](/moxiecode/plupload/blob/master/src/plupload.js#L1339)_

Removes all event listeners.


### destroy _Defined at: [src/plupload.js:1352](/moxiecode/plupload/blob/master/src/plupload.js#L1352)_

Destroys Plupload instance and cleans after itself.


Events

### Init _Defined at: [src/plupload.js:1365](/moxiecode/plupload/blob/master/src/plupload.js#L1365)_

Fires when the current RunTime has been initialized.


### PostInit _Defined at: [src/plupload.js:1372](/moxiecode/plupload/blob/master/src/plupload.js#L1372)_

Fires after the init event incase you need to perform actions there.


### Refresh _Defined at: [src/plupload.js:1379](/moxiecode/plupload/blob/master/src/plupload.js#L1379)_

Fires when the silverlight/flash or other shim needs to move.


### StateChanged _Defined at: [src/plupload.js:1386](/moxiecode/plupload/blob/master/src/plupload.js#L1386)_

Fires when the overall state is being changed for the upload queue.


### UploadFile _Defined at: [src/plupload.js:1393](/moxiecode/plupload/blob/master/src/plupload.js#L1393)_

Fires when a file is to be uploaded by the runtime.


### BeforeUpload _Defined at: [src/plupload.js:1401](/moxiecode/plupload/blob/master/src/plupload.js#L1401)_

Fires when just before a file is uploaded. This event enables you to override settings on the uploader instance before the file is uploaded.


### QueueChanged _Defined at: [src/plupload.js:1410](/moxiecode/plupload/blob/master/src/plupload.js#L1410)_

Fires when the file queue is changed. In other words when files are added/removed to the files array of the uploader instance.


### UploadProgress _Defined at: [src/plupload.js:1417](/moxiecode/plupload/blob/master/src/plupload.js#L1417)_

Fires while a file is being uploaded. Use this event to update the current file upload progress.


### FilesRemoved _Defined at: [src/plupload.js:1425](/moxiecode/plupload/blob/master/src/plupload.js#L1425)_

Fires while a file was removed from queue.


### FilesAdded _Defined at: [src/plupload.js:1433](/moxiecode/plupload/blob/master/src/plupload.js#L1433)_

Fires while when the user selects files to upload.


### FileUploaded _Defined at: [src/plupload.js:1441](/moxiecode/plupload/blob/master/src/plupload.js#L1441)_

Fires when a file is successfully uploaded.


### ChunkUploaded _Defined at: [src/plupload.js:1450](/moxiecode/plupload/blob/master/src/plupload.js#L1450)_

Fires when file chunk is uploaded.


### UploadComplete _Defined at: [src/plupload.js:1459](/moxiecode/plupload/blob/master/src/plupload.js#L1459)_

Fires when all files in a queue are uploaded.


### Error _Defined at: [src/plupload.js:1467](/moxiecode/plupload/blob/master/src/plupload.js#L1467)_

Fires when a error occurs.


### Destroy _Defined at: [src/plupload.js:1475](/moxiecode/plupload/blob/master/src/plupload.js#L1475)_

Fires when destroy method is called.


Clone this wiki locally