I've been searching for a while now and I can't seem to find a satisfactory answer.
Essentially, I have a website where users can input values and download a specific file based on those values. Everything is functional, but I want to give the user the option to choose where to save the file instead of it automatically downloading to the default location on their browser.
This is how I am currently initiating the download process:
/**
* This function gets the data file URL and prompts the user to download it
**/
function getResultDataHandler(result, messages) {
var dataURL = result.value.url;
var askUser = confirm("Save File?");
if (askUser == true) {
download(dataURL);
}
else {
console.log("Download canceled");
}
showMessage("", true);
}
/**
* Opens the download dialog in a new window/tab
**/
function download(dataURL) {
console.log("Downloading...");
window.open(dataURL, 'Download');
}