By jnt on
Hi, I am trying to redirect the user to a clean node after downloading a file to the user. It works but is producing the normal pre-empted header error in the watchdog log:
warning: Cannot modify header information - headers already sent by (output started at /home/james/public_html/drupal/modules/webform/webform.inc
Here is the code fragment:
...
$title_string = $node_info->title;
$file_name = _webform_print_csv_string($title_string,arg(2),'file');
drupal_set_header("Content-type: text/html; charset=utf-8");
drupal_set_header("Content-Disposition: attachment; filename=" . $title_string . ".csv");
@readfile($file_name);
drupal_goto("webform"); // and back to the start
...
How should this be done? As I say, it is working as far as the user is concerned, but producing the watchdog error entry.
I tried a few interdictory lines, ie: //while (@ob_end_flush()); // No avail !!