2016-07-25 59 views
4

我有以下的在视觉上嵌入我的网页上的PDF:铬嵌入式PDF下载文件名

<embed src="modules/files/actions/get_file.php?id=134" 
type="application/pdf" 
style="border: 0px; width: 100%; min-height: 500px" 
title="Project Report project_102587.pdf"> 

当我使用的镀铬内部PDF阅读器的下载按钮,建议的文件名显示为get_file,但我希望它像项目属性中的项目报告project_102587.pdf一样。 我该怎么做?

回答

1
在get_file.php

添加包含文件名标题(数据流之前,将其添加)

header('Content-Disposition: inline; filename="Project_Report_xxxx.pdf"');