display .msg file in browser using php

后端 未结 3 1470
花落未央
花落未央 2021-01-16 06:02

I have attached outlook msg file in php application. I am storing that file in sql server database.

Now i want to open and display it from browser.

I tried

3条回答
  •  青春惊慌失措
    2021-01-16 06:42

    I had an almost similar situation and was able to solve it. Include the headers below and it should work just fine.

    Regards

    header("Pragma: public");
    header("Expires: 0");
    header('Content-Encoding: UTF-8');
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Content-type: application/vnd.ms-outlook;charset=UTF-8"); 
    header("Content-Type: application/force-download");
    header("Content-Type: application/octet-stream");
    header("Content-Type: application/download");;
    header("Content-Disposition: attachment;filename=test.msg");
    header("Content-Transfer-Encoding: binary ");
    

提交回复
热议问题