2.7.0 (2023-09-12)
🏭 New feature(s)
<head>
<script type="module">
import wretch from 'https://cdn.skypack.dev/wretch';
import FormDataAddon from 'https://cdn.skypack.dev/wretch/addons/formData';
const fileInput = document.querySelector("#myfiles");
fileInput.addEventListener("change", () => {
wretch("/post-files")
.addon(FormDataAddon)
.formData({ files: fileInput.files })
.post()
.text(console.log)
});
</script>
</head>
<body>
<input id="myfiles" multiple type="file" />
</body>