dilsh Posted February 18, 2009 Share Posted February 18, 2009 Hi, I am a newbie in PHP. I have an issue with one of my server. When I download the files using PHP header from the server. A new line is added at the begin of file content. So the files are corrupting. Here is the code I use for downloading. header('Content-type: application/octet-stream'); header("Content-Disposition: attachment; filename=\"".$this->file_name."\""); foreach($this->headers as $key => $value) { header("{$key}: {$value}"); } echo $this->file_content; The same script is working in other servers and my local machine. But not in one server, unfortunately that one is my live server Could anybody help me on this? Thanks in advance Dil Link to comment https://forums.phpfreaks.com/topic/145691-new-line-added-at-the-begining-of-document-while-downloading/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.