I want to make a function which will forcefully download a file on client side wothout help of server. The following function is not working and showing the error that header is undefined. Help would be appreciated.
function download() {
var url = "C:\Koala.jpeg";
var request = new XMLHttpRequest();
header("Content-Type: application/force-download");
header("Content-disposition: attachment; filename=url");
header("Content-type: application/octet-stream");
window.open(url, 'Download');
}