How can I improve the download speed of a local file using a JavaScript function?
I have been struggling to get my button to trigger the download process through JavaScript. Here is the code I am currently using, where the function takes in the file name as an argument and the path remains static:
function downloadFile(fileName) {
var filePath = "C:\\LangsDirectory\\Test\\" + fileName;
var downloadLink = document.createElement("a");
downloadLink.href = uri;
downloadLink.download = filePath;
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);
}