简体   繁体   中英

Python file opens up in browser window instead of download prompt

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

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

I know I'm probably doing something very stupid, but the tutorials told me to do this.

在HTML5 download将做到这一点

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM