o0'*_*0'. 7 php content-type google-chrome http-headers mime-types
如果我调用header('Content-Type:text/plain; charset=ISO-8859-15');浏览器将下载文件而不是显示它.text/html改为使用作品.(无论如何处理下载的文件,它不下载源代码)
我试图添加,header('Content-Disposition:inline;');但它只是被忽略了.
我对于什么可能导致这个问题,任何小费都很无能为力?
服务器是MAMP 1.9.6(PHP 5.3.5,Apache/2.0.64).
编辑:这只发生在Chrome上,适用于Firefox,Camino和Safari.
Dav*_*dom 11
我不能用这个脚本重现这个:
<?php
header('Content-Type:text/plain; charset=ISO-8859-15');
echo "This is some text";
Run Code Online (Sandbox Code Playgroud)
但是,我可以用这个重现它:
<?php
header('Content-Type:text/plain; charset=ISO-8859-15');
echo "\x00This is some text";
Run Code Online (Sandbox Code Playgroud)
确保您的内容实际上是纯ASCII文本...