Search code examples
htmlbrowserdownloadhref

Download a file instead of opening in a web page


I need to download a CSV file hosted on my Google Drive with a hyperlink. Whenever I click the download link, I get a garbage file named as view.html. What can be the reason for this unusual behavior? Demo HTML lines are:

<html>
<body>
<a  href="https://drive.google.com/open?id=0ByK27OBInnBnUlJ1ZFg3WVVQbjQ" download> Demo data </a>                       
</body>
</html>

Solution

  • Because this is just the sharing link. You need to generate the direct download link separately. It's this one.