This example shows you how to use the jQuery UI widget.

Your browser doesn't have HTML5 support.


View Source
<div id="uploader">
	<p>Your browser doesn't have HTML5 support.</p>
</div>

<script type="text/javascript">
// Initialize the widget when the DOM is ready
$(function() {
	$("#uploader").plupload({
		// General settings
		runtimes : 'html5,html4',
		url : "/examples/upload",

		// Maximum file size
		max_file_size : '2mb',

		chunk_size: '1mb',

		// Resize images on clientside if we can
		resize : {
			width : 512, 
			height : 512, 
			quality : 90,
			crop: true // crop to exact dimensions
		},

		// Specify what files to browse for
		filters : [
			{title : "Image files", extensions : "jpg,gif,png"},
			{title : "Zip files", extensions : "zip,avi"}
		],

		// Rename files by clicking on their titles
		rename: true,
		
		// Sort files
		sortable: true,

		// Enable ability to drag'n'drop files onto the widget (currently only HTML5 supports that)
		dragdrop: true,

		// Views to activate
		views: {
			list: true,
			thumbs: true, // Show thumbs
			active: 'thumbs'
		}
	
	});
});
</script>