JavaScript: download file with fetch
In this post you will learn how to download a file in the background using client-side JavaScript and the fetch function to make HTTP requests. We will see how to download a file as a blob using AJAX and then ask the user where to save it, suggesting a name. The good thing about this is that we can send parameters to request the download of the file (for example, we can send a password over a POST request if the server requires it). ...