Last active
August 21, 2016 08:58
-
-
Save jayarjo/5836202 to your computer and use it in GitHub Desktop.
Plupload Examples: Getting Started
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
<title>Plupload - Getting Started</title> | |
<script type="text/javascript" src="js/plupload.full.min.js"></script> | |
</head> | |
<body> | |
<ul id="filelist"></ul> | |
<br /> | |
<div id="container"> | |
<a id="browse" href="javascript:;">[Browse...]</a> | |
<a id="start-upload" href="javascript:;">[Start Upload]</a> | |
</div> | |
<br /> | |
<pre id="console"></pre> | |
<script type="text/javascript"> | |
var uploader = new plupload.Uploader({ | |
browse_button: 'browse', // this can be an id of a DOM element or the DOM element itself | |
url: 'upload.php' | |
}); | |
uploader.init(); | |
uploader.bind('FilesAdded', function(up, files) { | |
var html = ''; | |
plupload.each(files, function(file) { | |
html += '<li id="' + file.id + '">' + file.name + ' (' + plupload.formatSize(file.size) + ') <b></b></li>'; | |
}); | |
document.getElementById('filelist').innerHTML += html; | |
}); | |
uploader.bind('UploadProgress', function(up, file) { | |
document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = '<span>' + file.percent + "%</span>"; | |
}); | |
uploader.bind('Error', function(up, err) { | |
document.getElementById('console').innerHTML += "\nError #" + err.code + ": " + err.message; | |
}); | |
document.getElementById('start-upload').onclick = function() { | |
uploader.start(); | |
}; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can you please show the complete sample of addfilefilter for minsize and minresoultion?