开发者

php fpassthru has an extra character at the start of the file

I would like to be able to down load a file using a php script I am using the demo code from the m开发者_C百科an pages however my jpeg that is downloaded is corrupted. I did a hex compare and found that the downloaded file has one extra 0 bit at the begging of the file. How can I fix this?


I suspect that PHP is emitting some output before the JPEG file gets passed through. This could be because of whitespace before the opening

One thing to watch for is a BOM in UTF8 files. The BOM is unnecessary in UTF8, and can in fact lead to problems such as the one you're encountering, but some editors add it to UTF8 files anyway. How to remove it depends on your editor.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜