Skip to content

Instantly share code, notes, and snippets.

@DenoGeek
Created January 11, 2020 09:42
Show Gist options
  • Save DenoGeek/3423edde8e51cdd853805d02c4c5459f to your computer and use it in GitHub Desktop.
Save DenoGeek/3423edde8e51cdd853805d02c4c5459f to your computer and use it in GitHub Desktop.
Resumable js configuration
<script src="resumable.js"></script>
<script>
var r = new Resumable({
target:'http://localhost:8080/upload',
});
r.assignBrowse(document.getElementById('upload-area'));
// Resumable.js isn't supported, fall back on a different method
if(!r.support) location.href = '/some-old-crappy-uploader';
r.on('fileAdded', function(file){
console.log(file)
r.upload()
});
r.on('fileSuccess', function(file,message){
console.log("Success")
});
r.on('fileError', function(file, message){
console.log("Failed ")
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment