Python file opens in browser window instead of download prompt

I am trying to make files downloadable from my site, but when I test it by clicking on the download file, it opens the code in the webpage instead of downloading it. By the way, I am using Firefox.

<a href="currentage.py">Age calculator I made, where you plug in your birth year.</a>

      

I know I am probably doing something very stupid, but the tutorials told me to do it.

+3


source to share


1 answer


HTML5 download

will do the trick



<a href="currentage.py" download>Age calculator I made, where you plug in your birth year.</a>

      

+3


source







All Articles