Skip to content

Instantly share code, notes, and snippets.

@jayarjo
Last active December 20, 2015 01:09
Show Gist options
  • Save jayarjo/6047118 to your computer and use it in GitHub Desktop.
Save jayarjo/6047118 to your computer and use it in GitHub Desktop.
<div id="container">
<div id="filelist">No runtime found.</div>
<br />
<a id="pickfiles" href="javascript:;">[Select files]</a>
<a id="uploadfiles" href="javascript:;">[Upload files]</a>
</div>
$(document).ready(function() {
function $(id) {
return document.getElementById(id);
}
var uploader = new plupload.Uploader({
runtimes : 'html5,flash,silverlight,browserplus',
browse_button : 'pickfiles',
container: 'container',
max_file_size : '10mb',
url : 'upload.php',
resize : {width : 320, height : 240, quality : 90},
flash_swf_url : 'http://rawgithub.com/moxiecode/plupload/1.x/js/plupload.flash.cors.swf',
silverlight_xap_url : '../js/plupload.silverlight.xap',
filters : [
{title : "Image files", extensions : "jpg,gif,png"},
{title : "Zip files", extensions : "zip"}
]
});
uploader.bind('Init', function(up, params) {
$('filelist').innerHTML = "<div>Current runtime: " + params.runtime + "</div>";
});
uploader.init();
uploader.bind('FilesAdded', function(up, files) {
plupload.each(files, function(file) {
$('filelist').innerHTML += '<div id="' + file.id + '">' + file.name + ' (' + plupload.formatSize(file.size) + ') <b></b></div>';
});
});
uploader.bind('UploadProgress', function(up, file) {
$(file.id).getElementsByTagName('b')[0].innerHTML = '<span>' + file.percent + "%</span>";
});
$('uploadfiles').onclick = function() {
uploader.start();
return false;
};
});
name: Plupload #842
description: https://github.com/moxiecode/plupload/issues/842
authors:
- Davit Barbakadze
resources:
- https://rawgithub.com/moxiecode/plupload/1.x/js/plupload.full.js
normalize_css: no
{{"jsonrpc" : "2.0", "result" : null, "id" : "id"}
@jayarjo
Copy link
Author

jayarjo commented Jul 21, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment