-1

How can I create a download link for my existing Excel file?

<a href='/path/to/excel/file.xls' download="file.xls">Download </a>   

I tried this and it did not allow me to download the file. Do I need to copy my Excel file to Visual Studio?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38

1 Answers1

1

If it doesn't work as a link, you can also try it as a button :

<form>
<input type="button" value="Download" onClick="window.location.href='/path/to/excel/file.xls'">
</form>
vishwampandya
  • 1,067
  • 11
  • 11