html – Chrome嵌入式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">

当我使用chrome internal pdf viewer的下载按钮时,建议的文件名显示为get_file,但是我希望它像title属性一样是Project Report project_102587.pdf.
我怎样才能做到这一点?

最佳答案 在get_file.php中添加包含文件名的头文件(在数据流之前添加)

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