Consider the following page:
https://8chan.co/stackoverflow.html
Why does the first link work, but the second link doesn't? Do I need to send a certain header, or is it impossible to use the download
attribute on a subdomain?
Consider the following page:
https://8chan.co/stackoverflow.html
Why does the first link work, but the second link doesn't? Do I need to send a certain header, or is it impossible to use the download
attribute on a subdomain?
Chrome actually does allow the download attribute on cross-origin files, without CORS headers, but Firefox chose not to, citing potential social-engineering attacks.
Check this link... HTML5 download attribute not working when downloading from another server, even when Access-Control-Allow-Origin is set to all (*)
You could fix it with php proxy file something like:
<?php
$url = $_GET['file'];
$name = $_GET['name'];
header("Content-type: application/$ext");
header("Content-Disposition: attachment; filename=".$name);
echo readfile($url);
?>