¿Cómo subo un archivo con la API de búsqueda de JS?

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 atrapar elsubmit evento usando<fill in your event handler here>. Pero una vez que lo hago, ¿cómo envío el archivo usandofetch?

fetch('/files', {
  method: 'post',
  // what goes here? What is the "body" for this? content-type header?
}).then(/* whatever */);

Respuestas a la pregunta(7)

Su respuesta a la pregunta