<html>
<head>
<script src="https://js.bytescale.com/upload-widget/v4"></script>
</head>
<body></body>
</html>
// ---------------------------
// Configuration
// See: https://www.bytescale.com/docs/upload-widget#configuration
// ---------------------------
const options = {
apiKey: "free", // Get API keys from: www.bytescale.com
maxFileCount: 1,
// mimeTypes: ["image/*"] // If you require images only.
};
//
// See: https://www.bytescale.com/docs/upload-widget#configuration
//
Bytescale.UploadWidget.open(options).then(
files => alert(files.length === 0
? "No file selected."
: `File uploaded:\n\n${files.map(x => x.fileUrl).join("\n")}`),
error => alert(error)
);