Skip to content

2.7.0

Compare
Choose a tag to compare
@elbywan elbywan released this 12 Sep 17:37
· 53 commits to master since this release

2.7.0 (2023-09-12)

🏭 New feature(s)

  • Support FileList objects in the form data addon (3582809), closes #201
<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>

📝 Documentation update(s)

  • Mention file names in the form data addon doc (411fb09), closes #197