I'm generating a CSV which outputs fine to the browser using a few headers()...
Code: Select all
csv.php
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=users.csv");
header("Content-Type: text/csv");
echo $output;
exit;
Code: Select all
cron.php
$attachments = array(file_get_contents('csv.php'));
Can anyone advise on where I am going wrong?
Thanks in advance!