PHP File unreadable after being downloaded

Posted by Drew on Stack Overflow See other posts from Stack Overflow or by Drew
Published on 2010-04-18T16:40:08Z Indexed on 2010/04/18 16:43 UTC
Read the original article Hit count: 507

Filed under:
|
|
|

Hi I have a script that creates a file and stores it on the server. The file is encoded in UTF-8 and is a kind of xml file for the cmap software.

If i open the file directly from the server then there is no problem and the file can be read.

I am forcing a download of this file when a user goes to a specific url. After such a download, the file is unreadable by the cmap software. I have to go into my text editor (notepad++) and change the encoding from UTF-8 to UTF-8 without BOM.

Am I sending the wrong headers? Is php doing something to the file when it is downloading it?

Any advice on this would really be appreciated.

Cheers Drew

© Stack Overflow or respective owner

Related posts about php

Related posts about headers