PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
if(isset($_GET['fileToDownload']))
{
header('Content-type: application/csv');
$fileToDownload=$_GET['fileToDownload'];
// It will be called downloaded.pdf
header("Content-Disposition: attachment; filename="$fileToDownload"");
readfile("./outfile/$fileToDownload");
}
else
echo "unable to find ".$_GET['fileToDownload'];
?>
which opens up the open/save dialague box and the links on my original page still work.
Your code definitely brings up the save box, I can also save the file.
But if I click on my menu item which is in a separate frame. The main (page loading) frame remains stuck.