-2

Is there way to tell browser (i care mainly about Google Chrome which looks to have "Microsoft Office 2010" plugin) to open Microsoft Word document inside of browser using PHP?

RESULT: all tries made browser to download file. Looks like this Chrome plugin serves for something else than rendering .doc files.

4

3 回答 3

1

尝试设置Content-Disposition为内联

header("Content-Disposition", "inline;filename=somefile.ext")
于 2012-08-22T01:09:32.387 回答
1

是的。正确设置 MIME 类型,然后将Content-Disposition标头设置为inline.

<?php
header('Content-Disposition: inline; filename=blah.doc');
?>
于 2012-08-22T01:09:43.243 回答
0

您可以使用 GET 请求中的文件 URL 创建重定向到谷歌文档查看器。

例如,如果您想在 URL http://research.google.com/archive/bigtable-osdi06.pdf查看 PDF ,您可以使用 URL:http ://docs.google.com/viewer?url =http%3A%2F%2Fresearch.google.com%2Farchive%2Fbigtable-osdi06.pdf

于 2012-08-22T01:10:04.057 回答