Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A jQuery plugin that makes working with SWFUpload even easier.

branch: master
README
SWFUpload jQuery Plugin v1.0.0
-------------------------------
Copyright (c) 2009 Adam Royle. Licensed under the MIT license.
 

Overview
--------

A jQuery plugin that makes working with SWFUpload even easier.

Features include:
	- jQuery-style instantiation
	- jQuery-style event handling
	- Ability to separate SWFUpload object from UI code
	

Usage
-----

// create the swfupload instance (settings must be an object)
$('.swfupload-control').swfupload(settings);

// add some additional handlers (for any plugins if used)
$.swfupload.additionalHandlers('some_extra_handler', 'another_extra_handler');

// same as above but as an array
$.swfupload.additionalHandlers(['some_extra_handler', 'another_extra_handler']);

// or just return an array of the additional handler names
$.swfupload.additionalHandlers();

// or return an array of the default handler names
$.swfupload.defaultHandlers();

// bind the swfupload event handlers like an other jquery event
$('.swfupload-control')
	.bind('swfuploadLoaded', function(event){
		console.debug('swfuploadLoaded!!', event);
	})
	.bind('fileQueued', function(event, file){
		$(this).swfupload('startUpload');
		console.debug('fileQueued!!', event);
	});


// call methods on the swfupload instances by passing a string as the first parameter
// this method is chainable and therefore does not return any values
$('.swfupload-control').swfupload('startUpload', fileID);
$('.swfupload-control').swfupload('cancelUpload', fileID, triggerErrorEvent);

// or if you prefer, you can just get the instance directly
// if you need any return values for methods
$.swfupload.getInstance('.swfupload-control');



Event Names (and, their, params)
--------------------------------

swfuploadPreload (event)
swfuploadLoadFailed (event)
swfuploadLoaded (event)
fileDialogStart (event)
fileQueued (event, file)
fileQueueError (event, file, errorCode, message)
fileDialogComplete (event, numFilesSelected, numFilesQueued)
// uploadResizeStart (event) // can't see where this is called from their code
uploadStart (event, file)
uploadProgress (event, file, bytesComplete, bytesTotal)
uploadError (event, file, errorCode, message)
uploadSuccess (event, file, serverData, responseReceived)
uploadComplete (event, file)
mouseClick (event)
mouseOut (event)
mouseOver (event)
queueComplete (event, uploadCount) // from queue plugin
Something went wrong with that request. Please try again.