Created
January 11, 2020 09:42
-
-
Save DenoGeek/3423edde8e51cdd853805d02c4c5459f to your computer and use it in GitHub Desktop.
Resumable js configuration
This file contains 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
<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