I have PHP issue, I’m trying to force a file download using php
if users click on my link http://www.site.com/download.php it redirects them to download.php with the following code inside the download.php file
header('Content-Type: application/csv');
header('Content-Disposition: attachment; filename=custom_report.csv');
header('Pragma: no-cache');
echo readfile('files/csv/custom_report.csv');
readfile and fopen however is disabled on the server for security purposes.
Is there any other way I can do this
How about file_get_contents()?