gpt4 book ai didi

php - Google Chrome 将文件 .xml 重命名为 .download

转载 作者:行者123 更新时间:2023-11-28 02:17:28 25 4
gpt4 key购买 nike

我有这个非常简单的下载页面来获取 xml 文件。该脚本在 firefox/IE 中运行正常。但 chrome 将文件的扩展名重命名为“.download”。这只会发生在 .xml 上,当您使用另一个扩展名(如 .txt)时,它可以毫无问题地完成。

html 的主体是这样的:

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

PHP 是这样的:

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

这很奇怪。有什么解决办法吗??

最佳答案

这不是一个确定的答案,只是一些信息给你。

来自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).

关于php - Google Chrome 将文件 .xml 重命名为 .download,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3096146/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com