Jump to content

New line added at the begining of document while downloading


dilsh

Recommended Posts

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

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.