[eluser]ZeroLag[/eluser]
I am having problems with a tab character being added to a text file that I create on the fly, and push out via initiating a file download in the browser. The string is XML, and since there is space being added at the beginning, it fails XML validation. I have just put in a test string for privacy purposes in my example below:
This is in my controller:
Code:
$qwc = array('qwcFileName'=>'Test.txt', 'qwcData'=>'Test');
$length = strlen($qwc['qwcData']);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, pre-check=0");
header("Cache-Control: private", false);
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"" . $qwc['qwcFileName'] . "\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: $length");
print $qwc['qwcData'];
Is always outputs with a tab character before the word test in my output file sent to the browser. Can anyone help me with this? It's driving me crazy.
Thanks,
Steve