2
Answers

i have physical path how to download that file from js

Photo of Guest User

Guest User

5y
5k
1
function download(filename, text) {
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}

Answers (2)

2
Photo of Priyanka Jain
NA 9.6k 904.3k 5y
Please refer below link https://stackoverflow.com/questions/3749231/download-file-using-javascript-jquery
0
Photo of Bidyasagar Mishra
NA 5.3k 379.6k 5y
get the complete solution from the below link 
https://stackoverflow.com/questions/3749231/download-file-using-javascript-jquery