I'm trying to download file from PHP page, which apparently is in vain. Apologies for a goofy problem.
My code looks like:
Code: Select all
<?php
header('Content-Description: File Transfer');
header('Pragma: public');
?>
<a href="<?php echo "/Users/user_name/Desktop/otu_table_tabseparated.txt";?>"> Download</a>
The file is present at the location. On click of download link, my page navigates to:
It (above ) is not a valid path. Also, I do not want the want to refresh/navigate page.
I've .htaccess file
My local host points to ~/Sites directory
This code is the simplest I could come to learn on how to allow user download file, which unfortunately didn't work.
Please guide.