mozilla.org/en/docs/Web/API/File><code>File</code></a> object. The easiest way to do that is from a <code>&lt;input type=&quot;file&quot;&gt;</code>.</p>
<pre><code class=language-javascript>m.render(document.body, [
    m(&quot;input[type=file]&quot;, {onchange: upload})
])

function upload(e) {
    var file = e.target.files[0]
}</code></pre>
<p>The snippet above renders a file input. If a user picks a file, the <code>onchange</code> event is triggered, which calls the <code>upload</code> function. <code>e