duanshaiduhao2471 2015-11-02 09:08
浏览 22
已采纳

Image在文件开头有一个回车符

I was handed over a site for maintenance/enchancement. The site's platform is running on PHP5, older version of OpenCart (1.5.x).

There is a part where the user is able to download image files using a jquery-based file manager to display files from the /image/ folder.

What happens is that the image file after download fails to load in any image editor/viewer application. When I examined the file with a hex editor, I found out that the start of the JPEG or PNG files starts with a 0x0A (a carriage return). This is the one that is causing the image to fail to be read properly, but how it got there has stumped me since this morning.

There is a testing site on another server with a similar setup. The images can be downloaded and opened correctly. The code should be the same. This part was not touched so I am at a loss on why this happens on Live but not on Testing site.

Has anybody encountered this before, and what is the fix?

Thanks!

  • 写回答

1条回答 默认 最新

  • dq_1984 2015-11-02 11:19
    关注

    Oh good lord, there was a carriage return in one of the include files after the ending PHP tag! I should have known this earlier. (facepalm)

    Thanks for all the replies.

    Regards, Marky

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 想用adb命令做一个通话软件,播放录音
  • ¥30 Pytorch深度学习服务器跑不通问题解决?
  • ¥15 部分客户订单定位有误的问题
  • ¥15 如何在maya程序中利用python编写领子和褶裥的模型的方法
  • ¥15 Linux权限管理相关操作(求解答)
  • ¥15 Bug traq 数据包 大概什么价
  • ¥15 在anaconda上pytorch和paddle paddle下载报错
  • ¥25 自动填写QQ腾讯文档收集表
  • ¥15 DbVisualizer Pro 12.0.7 sql commander光标错位 显示位置与实际不符
  • ¥15 android 打包报错