I am trying to use elninotech/uppload, as it looks like it will do what I want (give me a portable, easy to use, powerful file upload button). However when I click on the button, the upload dialog appears and disappears (press pause, in debugger, before pressing button, then single step. On 2nd step dialog appears, on 3rd step it disappears).
What am I doing wrong? (or is this library broken?).
<html>
<head>
<title>choose file experiment</title>
</head>
<body>
<div class="narrow">
<form class="profile">
<button id="uploadButton">upload image</button>
</form>
</div>
</body>
<script src="https://unpkg.com/uppload/dist/uppload.min.js"></script>
<script>
const profilePicture = new Uppload({
// Default file value, useful for empty-state images
value: "https://randomuser.me/api/portraits/men/17.jpg",
// Change the values of these elements with the file URL
// Sets `value` for inputs and `src` for images
//bind: ["#profilePicInput", "#profilePicImage"],
// Open the modal when the user clicks on this button
call: ["form.profile button#uploadButton"],
// Endpoint to send files to
// Use either this or `uploadFunction` for a custom function
//endpoint: "https://example.com/upload_backend",
// Maximum file size allowed in bytes (this is 25 MB)
//maxFileSize: 25000000,
// Types of files to allow (string or MIME type array)
allowedTypes: "image"
});
</script>
</html>
Aucun commentaire:
Enregistrer un commentaire