I have a PHP app that creates a CSV file which is forced to download using headers. Here's the relevant part of the code:
header('Content-Type: application/csv');
header("Content-length: " . filesize($NewFile));
header('Content-Disposition: attachment; filename="' . $FileName . '"');
echo $content;
exit();
What I'd like to do is redirect users to a new page after the file is built and the download prompt is sent. Just adding header("Location: /newpage")
to the end didn't work, expectedly, so I'm not sure how to rig this up.