Todavía estoy tratando de entenderlo.
Puedo hacer que el usuario seleccione el archivo (o incluso varios) con la entrada del archivo:
<form>
<div>
<label>Select file to upload</label>
<input type="file">
</div>
<button type="submit">Convert</button>
</form>
Y puedo ver el submitevento usando <fill in your event handler here>. Pero una vez que lo hago, ¿cómo envío el archivo usando fetch?
fetch('/files', {
method: 'post',
// what goes here? What is the "body" for this? content-type header?
}).then(/* whatever */);
Content-Type: multipart/form-dataen el encabezado de la solicitud