duanhan9334 2011-09-09 18:10
浏览 36
已采纳

换行插入文件的开头

I have code that generates a Google KML feed on my primary production server that works fine. When I copy it to the secondary production mirror, there's a newline at the beginning of the file. Everything else works fine. Would anyone happen to know which configuration options could possibly force a newline to be the first character of a file being created?

Code to generate the file:

header('Content-type: application/vnd.google-earth.kml+xml');
header('Content-Disposition: attachment; filename="My KML.kml"');
echo '<?xml version="1.0" encoding="UTF-8"?>
' .
     '<kml xmlns="http://earth.google.com/kml/2.2">
' .
     '(The rest of the KML code)';
  • 写回答

1条回答 默认 最新

  • duanlu0386 2011-09-10 04:17
    关注

    Most likely the file is being included from another file which has an extra carriage return at the bottom. Find the file with the extra carriage return and you will find the culprit.

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

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改