`
hongtoushizi
  • 浏览: 359329 次
  • 性别: Icon_minigender_1
  • 来自: 天津
社区版块
存档分类
最新评论

IE tries to download json/application

阅读更多

      最近用blueimp上传图片的时候,发现在ie下上传失败,总是提示下载文件。后研究发现,是由于ie8不支持aplication/json的缘故,故需要强制将ie的content-type设定为text/plain ,设置代码如下:

                                      if (isset($_SERVER['HTTP_ACCEPT']) &&

(strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false)) {

$response->headers->set('Content-type', 'application/json; charset=utf-8');

} else {

$response->headers->set('Content-type', 'text/plain; charset=utf-8');

}。

    因为本人项目中用的是symfony2,对于项目返回的response的对象在eventLister中的onKernelResponse方法中做了统一处理,所以在control中修改header的content-type信息一直失败。后来才发现eventLister中有关于 这个统一设定。

 

     参考资料:  

        ie  不支持  aplication/json :

          https://github.com/blueimp/jQuery-File-Upload/issues/123

          https://github.com/astaxie/beego/issues/165

          http://stackoverflow.com/questions/13943439/json-response-download-in-ie710

         https://github.com/blueimp/jQuery-File-Upload/issues/123     

         http://stackoverflow.com/questions/13943439/json-response-download-in-ie710

 

       accept:Vary:

         http://stackoverflow.com/questions/1975416/trying-to-understand-the-vary-http-header

          http://keystonewebsites.com/articles/mime_type.php

       http://www.456bereastreet.com/archive/200408/content_negotiation/

       http://blogs.msdn.com/b/ieinternals/archive/2009/06/17/vary-header-prevents-caching-in-ie.aspx

      http://blogs.msdn.com/b/ieinternals/archive/2009/06/17/vary-header-prevents-caching-in-ie.aspx

 

 

 

 

  

 

 

 

0
2
分享到:
评论

相关推荐

    json序列化jar包

    JavaScript Object Notation (aka JSON) is a very popular alternative to XML for transmitting data to the web browser. Flexjson is a lightweight library for serializing and deserializing Java objects ...

    frontmatterify:前端文件的 Browserify 转换

    目前,预计文件具有以下扩展名: // tries to transform // *.yaml.fm// *.json.fmvar page = require ( './articles/page.yaml.fm' ) ; // YAML front mattervar other = require ( './articles/other.json.fm' ) ...

    gwget-1.0.1.tar

    Resume: By default, gwget tries to continue any download. Notification: Gwget tries to use the Gnome notification area support, if available. You can close the main window and gwget runs in the ...

    CherryPy Essentials - Rapid Python Web Application Development (2007).pdf

    tries to provide enough background to allow you to ponder the why and how of each decision made. Indeed writing software applications is not a precise science and compromises need to be undertaken ...

    amber-leaf-tile-tap-game

    0 , //cliocked itles at the beginning of the game time : 30 , // game level timeout, for example a user can refresh the game, each game has to initiate with an original timeout tries : 3 , // r...

    Aria2135032bit.7z

    aria2 can download a file from multiple sources/protocols and tries to utilize your maximum download bandwidth. It supports downloading a file from HTTP(S)/FTP/SFTP and BitTorrent at the same time, ...

    aria2 win64位版本

    aria2 can download a file from multiple sources/protocols and tries to utilize your maximum download bandwidth. It supports downloading a file from HTTP(S)/FTP/SFTP and BitTorrent at the same time, ...

    vlc资料_multicat

    Multicat tries to rebuild the internal clock of the input stream; but it wants to remain agnostic of what is transported, so in case of files the said clock is stored to an auxiliary file (example...

    IPv6编程手册

    IPV6编程手册 This book tries to outline how to write an IPv6-capable application on a UNIX socket API, or how to update your IPv4 application to be IPv6-capable. The book tries to show portable and ...

    cloud-native-programming-golang.pdf

    A monolithic application is a single application that tries to get numerous tasks accomplished at once. Then, as new features are needed, the application will get bigger and bulkier. This, in effect,...

    Flex HtmlComponent

    - Prompt user when a page tries to unload it - Supports FCKEditor editor* - Supports Xinha editor* - Supports States - Supports Databinding - Supports Styles - Customizable function to handle ...

    戴尔蓝牙365黑苹果驱动lion,10.7,10.6,10.5均可以使用

    If the kext is instead in /Extra the system errors out when it tries to load the kext in this case. If someone knows how to fix this dependency please let me know. OSX 10.5.x and 10.6.0 versions ...

    matplotlib Plotting Cookbook: Learn how to create professional scientific plots

    It tries to make easy things easy and hard things possible. You can generate plots, add dimensions to the plots, and also make the plots interactive with just a few lines of code with matplotlib. ...

    Android代码-TilelessMap

    This project tries to target the vacuum behind the enormous evolution of online mapping the last decade. There are situations when keeping a lot of structured map data in a device for the field is ...

    WPViewPDF v3.11 VCL/.NET/ActiveX (x32/x64) + Crack

    You can download a demo which includes the component as .NET, Delphi and ActiveX component and a small example application. The source for the components (C# and Pascal) is included as well. It ...

    IPV6 NETWORK PROGRAMMING

    For instance, the book recommends against the use of some of the IPv6 standard APIs - unfortunately, there are some IPv6 APIs that are inherently insecure, so the book tries to avoid (and discourage)...

    Advanced NT Security Explorer 2.0

    hashes, and tries to recover plain-text passwords. If it's possible to recover the password in a reasonable time, the password should be considered to be insecure. Some users like simple and easy to ...

    EurekaLog_7.5.0.0_Enterprise

    Later is supported when map2dbg.exe tool is placed in \Bin folder of EurekaLog installation (separate download is required) 5)....Added: Exception2HRESULT in EAppDLL to simplify developing DLLs with ...

    Application of the consultant role to parent-teacher management of school avoidance behavior

    Application of the consultant role to parent-teacher management of school avoidance behavior APPLICATION OF T H E CONSULTANT ROLE TO PARENT-TEACHER MANAGEMENT OF SCHOOL AVOIDANCE BEHAVIOR JO ANN ...

    SuRF: Practical Range Query Filtering with Fast Succinct Tries原文

    SuRF: Practical Range Query Filtering with Fast Succinct Tries

Global site tag (gtag.js) - Google Analytics