How do I get csv file to download on IE? Works on firefox

后端 未结 12 510
梦如初夏
梦如初夏 2020-12-02 10:10

I\'m struggling with an odd error. I have a simple web app that grabs stuff from a DB then outputs it as a downloadable csv file. It works on firefox and chrome, but IE fail

12条回答
  •  無奈伤痛
    2020-12-02 10:47

    Some time ago I've got a problem with IE6 opening pdf files, and crashing when AdobeReader 6.0 was installed and tried to open file in browser window. Than I found somewhere this header:

    header('Content-Type: application/force-download');
    

    And it solved the problem, every pdf file was downloaded and opened in Adobe instead of IE.

提交回复
热议问题