0

有一个上传文件的 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
)
4

1 回答 1

0

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

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

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

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

或者

header("Content-Type: text/plain");
于 2013-05-24T12:51:52.983 回答