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 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 组策略中的计算机配置策略无法下发
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊