Is there a way to download a file that has been uploaded in the browser using a file input? This will need to be a client-side solution(will save me time rather than uploading and deleting the file in the server if they cancel the form). I did ask my project manager "Why would you want to download a file you just uploaded seconds ago?", I didn't get a good answer, but they want it.
Select a file: <input type="file" id="file">
<a id='link' href="" download="download">Download</a>
<script>
link = document.querySelector("#link");
file = document.querySelector("#file");
// NEED TO DOWNLOAD SELECTED FILE LOCALLY
file.onchange = function() {
link.href = file.value;
}
</script>