<html>
<head>
<!-- Install jQuery & jQuery Uploader Plugin -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://js.bytescale.com/upload-widget-jquery/v4"></script>
<!-- Show an upload dropzone on page load -->
<script>
$(() => {
$(".upload-dropzone").bytescaleUploadWidget({
// ---------------------------
// Configuration
// See: https://www.bytescale.com/docs/upload-widget#configuration
// ---------------------------
apiKey: "free", // Get API keys from: www.bytescale.com
maxFileCount: 10,
showFinishButton: true,
dropzone: {
width: "600px",
height: "375px"
},
onUpdate: event => {
console.log("On update:");
console.log(JSON.stringify(event));
},
onComplete: files => {
if (files.length === 0) {
alert('No files selected.')
} else {
alert(files.map(f => f.fileUrl).join("\n"));
}
}
});
});
</script>
</head>
<body>
<div class="container">
<div class="upload-dropzone"></div>
</div>
</body>
</html>