Skip to content

Instantly share code, notes, and snippets.

@chris1111
Created December 24, 2022 13:11
Show Gist options
  • Save chris1111/0e25f604674df9ed03e5ef11ad069e70 to your computer and use it in GitHub Desktop.
Save chris1111/0e25f604674df9ed03e5ef11ad069e70 to your computer and use it in GitHub Desktop.
Upload Image HTML
<!DOCTYPE html>
<html>
</head>
<body>
<div id="container">
<div align="center">
<h1>Image Upload</h1>
<span style='font-size:100px;'>&#8681;</span>
</div>
</div>
</body>
</html>
<head>
<body style="background-color:#2d313a;">
<head>
<!-- Install jQuery & jQuery Uploader Plugin -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://js.upload.io/jquery-uploader/v3"></script>
<!-- Show an upload modal on button click -->
<script>
// Call once at the start of your app.
$.uploader.init({
apiKey: "free" // Your real API key.
});
$(() => {
$(".upload-btn").uploader({
multi: true,
onComplete: files => {
if (files.length === 0) {
alert('No image file selected?')
} else {
alert(files.map(f => f.fileUrl).join("\n"));
}
}
});
});
</script>
</head>
<body>
<div align="center">
<button class="upload-btn">Select image...</button>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment