Save onclick file
3 answers
You must set headers to tell the web browser to open the save file dialog box.
download.php
<?php header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=sample.csv"); readfile('file.csv'); ?>
showlinks.php
<a href="download.php">Download file</a>
+11