Due to Speed issues and threading I have generated a CSV file in a particular location
Admin - CSV - xyz.csv
I want to write a program to just made it available on view. I know how to make a tmp csv and use header function for making downloadable the csv, But I am looking for the approach which only take this xyz.csv available for download on a click. Please Help!
I read out lot of examples but not find exact answer for my question.
As per recommended I have tried.
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="data.csv"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'csv');
$objWriter->save('php://output');
exit;