Can I Configure An Html Button To Always "save Target As" When Being Clicked?
I'm generating CSV files in an application I'm doing. Right now I'm displaying the finished files as plain HTML links, but I would like to make them buttons. Question: Is it possi
Solution 1:
You can force download using PHP
<?php
header('Content-type: application/force-download');
$musicfile=$_GET["musicfile"];
if(file_exists($musicfile))
{
header('Content-Disposition: attachment; filename="'.$musicfile.'"');
readfile($musicfile);
}
?>
Solution 2:
I'm not sure how you plan to do this without some server help, but you could take a look at this and see if it helps you get somewhere http://www.jtricks.com/bits/content_disposition.html
Post a Comment for "Can I Configure An Html Button To Always "save Target As" When Being Clicked?"