AnsweredAssumed Answered

Why do I get 12 lines on the top of a CSV file when I export it using code?

Question asked by Amy Cox on Sep 29, 2015
Latest reply on Sep 29, 2015 by Amy Cox
I have created a Custom Reports Module and I need to export a CSV File. I am using the following code.  When it downloads from the website it has 12 extra blank lines on the top.  When I view the file from the server it doesn't have the extra lines.

         header('Content-Description: File Transfer');
         header('Content-Type: text/csv; charset=utf-8');
         header('Content-Disposition: attachment; filename="' . $fileInfo['name'] . '"');
         header('Content-Length: ' . filesize($fileInfo['name']));

What is going on to cause these extra lines?

Outcomes