I have a ZIP file. I want it so when a user clicks a link on a page, it will download the ZIP file.
I have the ZIP under pub/media/downloadable and inside there's a .htaccess file, and currently this is the content inside:
<IfVersion < 2.4> order allow,deny deny from all </IfVersion> <IfVersion >= 2.4> Require all denied </IfVersion> AddType application/octet-stream .zip
And the link on my page is this:
<a href="/pub/media/downloadable/zipfile.zip">Download ZIP Here</a>
But clicking on the link simply redirects to
/pub/media/downloadable/zipfile.zip instead of downloading, which brings a 404.
== UPDATE ==
To make the link downloadable, all I had to do was add the
download attribute to the
<a>, like this:
<a href="/pub/media/downloadable/zipfile.zip" download >Download ZIP Here</a>
However, when I tried to download it, Google Chrome said "Failed - No File". The path is correct and the file is there, with permissions 644.