![]() |
Help creating text file on the fly - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Help creating text file on the fly (/showthread.php?tid=17713) |
Help creating text file on the fly - El Forum - 04-13-2009 [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'); 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 Help creating text file on the fly - El Forum - 04-13-2009 [eluser]_www_[/eluser] Hello Steve, I just tested your source. Copy & paste into a new controller and executed it. I opened the resulting file in notepad. The result : there is no space or tab in front of the data. Of cause, this is a text file that contains no XML. But i guess you have replaced that for the posting. Help creating text file on the fly - El Forum - 04-13-2009 [eluser]ZeroLag[/eluser] I put my code in a NEW controller, and it works fine with and without real XML. It seems to only happen in my production controller, where I have a bunch of other code. I'm not sure where to even start looking for the issue. I guess I could make a new controller for just this functionality, but I don't really want to. Help creating text file on the fly - El Forum - 04-14-2009 [eluser]_www_[/eluser] Hello Steve, if it doesn't make sense, that the source code creates the wrong tab or space, then maybe it's one of these "space/tab in between ?> and <?php errors? |