I am using following PHP code to generate CSV file:
header("Expires: 0");
header("Cache-control: private");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Description: File Transfer");
header("Content-Type: text/csv");
header("Content-disposition: attachment; filename=site_list.csv");
The CSV file is generated successfully in all browsers. But the file generated by IE, when opened with MS Excel, shows all the data in single line.
PS:
- Files generated by other browsers (FF, Google Chrome) are behaving perfectly.
- I am using "\n" for line breaks.
- Using "\r\n" does not help