title: Download headers somehow inserting 18 lines of whitespace
body: <p>I am trying to serve up a dynamically generated csv file.  For some reason when I get the file, there are 18 empty rows preceding the data.  I don't have any space between the headers I define and the csv data I'm sending.  If I write the data to a file on the server, it does not get these empty rows.  However, if I write the file and then try to serve it to the user, the empty lines come back.  So I'm wondering if perhaps I've messed up the headers, or if perhaps there is another issue I'm not thinking of:</p>
  
  <pre><code>function generate_csv($source_type, $include_unpublished = FALSE) {
  
     // retrieve data from DB
     ....
  
     // start up headers
     $csv_name = "$source_type-$data_set-csv_" . date('Y-m-d') . '.csv';
     header('Content-Type: text/x-comma-separated-values');
     header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
     header('Cache-Control: private', false); // required for certain browser
     header('Content-Disposition: attachment; filename="' . $csv_name . '"'); 
  
     // send csv data
     print $csv_data;
  
  } //end function
  </code></pre>
  
  <p>Disclaimer: I asked this question at <a href="https://drupal.stackexchange.com/questions/27649/extra-empty-rows-when-serving-csv-file">https://drupal.stackexchange.com/questions/27649/extra-empty-rows-when-serving-csv-file</a>, but it dosn't seem to be drupal-specific and there weren't many ideas coming up over there..</p>