[英]Force browser to display PDF file instead of download
I found some solution for my issue by googling but none of them worked for me.我通过谷歌搜索找到了解决我的问题的方法,但没有一个对我有用。 I want to show a PDF file in a webpage but browser makes user to download it?
我想在网页中显示一个 PDF 文件,但浏览器让用户下载它? How can I solve this.
我该如何解决这个问题。 My code is below.
我的代码如下。
<?php
session_start();
$name = $_SESSION['src'];
$file= 'usr/'.$name.'/out.pdf'
?>
<!DOCTYPE html>
<html>
<page size="A4"><embed src=<?php echo $file?> type="application/pdf" width="800px" height="1100px" /></page>
</html>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.