Skip to content

Instantly share code, notes, and snippets.

@optlsnd
Created September 21, 2019 08:37
Show Gist options
  • Save optlsnd/5e4a10df6e6cd16e6c65828d4d5de96c to your computer and use it in GitHub Desktop.
Save optlsnd/5e4a10df6e6cd16e6c65828d4d5de96c to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Test JS upload</title>
<script src="uploader.js"></script>
</head>
<body>
<h1>JS Uploader test</h1>
<input type="file" id="file-upload">
<script>
var fileInput = document.getElementById('file-upload');
var uploader = new SimpleUploader();
fileInput.addEventListener('change', function(e) {
var fileUpload = uploader.upload(e.target, {});
console.log(fileUpload);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment