file-attachment

back edit

Use <file-attachment> to capture files to be uploaded.

<file-attachment class="text-center p-6 bg-gray">
  Upload files via the file input, drag and drop, or paste.
  <input type="file" class="d-block mt-2 mx-auto js-manual-file-chooser" multiple>
</file-attachment>
<pre class="mt-3">[Files to be uploaded]</pre>
const pre = document.querySelector('pre')
document.addEventListener('file-attachment-accepted', event => {
  pre.textContent = event.detail.attachments.map(a => a.file.name).join('\n')
})