0

I'm running the following code:

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>NHS Game</title>
    <link rel="stylesheet" href="{{url_for('static',filename='css/main.css')}}" />
</head>

<body>
    <a href="nhsgame(Mac).app" download="NHS Game"><img src="https://www.pngkey.com/png/full/901-9019597_apple-logo-riot-chat-logo.png" alt="MacOS" width="120" /></a>
    <a href="nhsgame (Mac).zip" download="NHS Game"><img src="https://www.pngkey.com/png/full/901-9019597_apple-logo-riot-chat-logo.png" alt="MacOS" width="120" /></a>
</body>

</html>

the website is loading fine, but when I download the file, it shows it as a '.html' file and underneath it says No file: enter image description here

Please help...

AG-88301
  • 127
  • 1
  • 10
  • Is there a file with `nhsgame(Mac).app` this name in your root folder with the html. – Manas Khandelwal Mar 27 '21 at 07:04
  • Yes, I have put it in the same folder I put the html file, though it is different from the one with the css file. Also, I'm running the HTML file through some python code, which is outside of the folder in which the html file is in. Sorry I failed to mention this in the main post – AG-88301 Mar 27 '21 at 07:05
  • are your filenames "nhsgame(Mac).app" and "nhsgame (Mac).zip" ? and are they located in the same folder with the html? share your folder structure if possible – mehmetx Mar 27 '21 at 07:09
  • 1
    This should help: https://stackoverflow.com/a/58125964/11171286 – Manas Khandelwal Mar 27 '21 at 07:16

1 Answers1

-2

In HTML5, in most browsers, you can add a 'download' attribute to the a element.

for example:

<a href="http://www.example.com/index.html" download>Download</a>
Pri Nce
  • 576
  • 6
  • 18