ole.warn("Failed to upload file", e);
                }
            }
            if (files.length !== 0) window.location.reload();
        }
    }

    function doupload(name, data) {
        return fetch(window.location.pathname + encodeURIComponent(name), {method:'PUT',body:data})
    }

    document.addEventListener("DOMContentLoaded", function(e) {
        console.log("DOM CONTENT LOADED");
        document.addEventListener("dragover", drag, false);
        document.addEventListener("dragleave", drag, 