I am using this javascript function to launch download
function startDownload(url) { window.open(url, \'Download\'); }
It works, but i
window.open will open a new window \ tab (depending on user preferences) ... to just download the file use
window.open
window.location.href = url;
You can use this if the url returns a downloadable file rather than a web page
url