在IE中iframe JSON响应提示下载

时间:2013-05-24 12:25:40

标签: php json internet-explorer response

拥有上传文件的iframe,iframe以JSON响应进行响应

如何强制IE不提示下载?是否可以在服务器端使用一些额外的标头来完成?

标题

Array
(
    [Host] => localhost:8080
    [User-Agent] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
    [Accept] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    [Accept-Language] => da,en-us;q=0.7,en;q=0.3
    [Accept-Encoding] => gzip, deflate
    [Referer] => http://localhost:8080/da/voucher/
    [Cookie] => session=192.168.1.36; PHPSESSID=54rbqritt9dmcpt82ujq2r0lk2
    [Connection] => keep-alive
    [Content-Type] => multipart/form-data; boundary=---------------------------143822985431828
    [Content-Length] => 7762362
)

1 个答案:

答案 0 :(得分:0)

确保您要发回的内容类型标题有效

header ("Content-Type: application/json");

这会让你感到悲痛,然后关闭:

header("Content-Type: text/javascript");

header("Content-Type: text/plain");
相关问题