开发者

Google Chrome renames file .xml to .download

i have this very simple download page to get an xml file. the script works ok in firefox/IE. but chrome renames the extension of the file to ".download". and this happens only to .xml, when you use another extension like .txt it does it without 开发者_如何学Cproblems.

the body of the html is this:

<body>
  <a href="down.php">descarga</a>
</body>

and the php is this:

header('Content-type: "text/xml"; charset="utf8"');
header('Content-disposition: attachment; filename="example.xml"');
echo "that's it";

its very strange. any solution for this??


This is not a definite answer, just some information for you.

From the bug report:

The downloaded file may get a different name if it is considered potentially dangerous for your computer (e.g. exe). You should then get an UI prompt in the download shelf asking you to confirm the download (with the file still downloading in the background).


try removing 'echo "that's it";' it makes the xml invalid and might confuse the browser. if it doesn't help, check the actual http headers of both request and response.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜