// Download the file

function downloadFile(url) { 

   var a = document.createElement(‘a’); 

  a.setAttribute(‘href’, url); 

// take the file name

 a.setAttribute(‘download’, url.split(‘/’).pop());

  a.setAttribute(‘target’, ‘_blank’); 

  a.click(); 

}