How to grab base32 from selected file?
<p>I have a website where you select a picture and you upload it - but how would I do it so it shows a preview of the image?</p>

<p>I have a javascript that shows the selected files in a list - but I plan to show a preview of the image via Base32 - but how would I go about doing this?</p>

<p>I've tried looking it up, but found no answers..</p>

<pre><code> function listFiles() {
            var input = document.querySelector("input[type='file']");
            var ul = document.querySelector("#bag&gt;ul");
            while (ul.hasChildNodes()) {
                ul.removeChild(ul.firstChild);
            }
            for (var i = 0; i &lt; input.files.length; i++) {

                var li = document.createElement("li");
                li.innerHTML = input.files[i].name;
                ul.appendChild(li);
            }
        }
</code></pre>

<p>I'm fairly new to this, so please try to do your best to explain it to me. Thanks!</p>
