1

PHPアプリケーションにOutlook msgファイルを添付しました。そのファイルをSQLサーバーデータベースに保存しています。

今、ブラウザから開いて表示したい。

私はこのコードを試しました:

  if($ext=="msg")
  {
    header('ContentType : application/octet-stream');
    header('Content-Disposition: attachment; filename='. basename($filename));
    echo base64_decode($file);
  }

$filename と $file はデータベースからのものです。

IE および chrome から Outlook で msg ファイルを開きますが、firefox からは開きません。

すべてのブラウザで動作させる方法はありますか?

または、どこか間違っていますか、ブラウザに設定がありますか?

4

3 に答える 3

1

私はほぼ同様の状況にあり、それを解決することができました。以下のヘッダーを含めると、問題なく動作するはずです。

よろしく

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 ");
于 2013-06-12T11:59:43.463 に答える
0
if($ext=="msg")
  {
    header("Content-Type: text/Calendar");
    header('Content-Disposition: inline; filename='. basename($filename));
    echo base64_decode($file);
  }
于 2013-05-02T11:26:30.857 に答える