【问题标题】:Chrome embedded PDF download filenameChrome 嵌入式 PDF 下载文件名
【发布时间】:2016-11-28 14:31:25
【问题描述】:

我有以下内容,可以在我的页面上直观地嵌入 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 内部 pdf 查看器的下载按钮时,建议的文件名显示为 get_file,但我希望它是项目报告 project_102587.pdf,就像标题属性中一样。 我该怎么做?

【问题讨论】:

    标签: html google-chrome pdf download filenames


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2022-10-15
      • 2016-02-04
      • 1970-01-01
      • 2016-07-03
      • 2021-04-30
      • 2018-05-15
      • 2019-07-14
      • 1970-01-01
      • 2020-07-28
      相关资源
      最近更新 更多