Javascript : Delete file from a folder after download
<p>I would ask if you can delete a file after you download it with javascript.
I thought of using the .remove () but with no effect.
Can someone help me?</p>

<pre><code>downloadlink var = document.createElement ( "a");
                    d = obj.d; # D is download method before
                    downloadlink.href = d;
                    downloadlink.className = "DOWNLOAD_LINK";
                    downloadlink.download = n;
                    downloadlink.onClick = setTimeout (function () {location.reload (true);}, 30000);
                    downloadlink.innerHTML = "&lt;p&gt; Download document" + n + "&lt;/ p&gt;";
                    document.getElementById ( "results"). appendChild (downloadlink);
</code></pre>

<p>How can I modify my code so that after downloading the files you delete it from the folder?</p>