<i id='2HlUo'><tr id='2HlUo'><dt id='2HlUo'><q id='2HlUo'><span id='2HlUo'><b id='2HlUo'><form id='2HlUo'><ins id='2HlUo'></ins><ul id='2HlUo'></ul><sub id='2HlUo'></sub></form><legend id='2HlUo'></legend><bdo id='2HlUo'><pre id='2HlUo'><center id='2HlUo'></center></pre></bdo></b><th id='2HlUo'></th></span></q></dt></tr></i><div id='2HlUo'><tfoot id='2HlUo'></tfoot><dl id='2HlUo'><fieldset id='2HlUo'></fieldset></dl></div>

        <small id='2HlUo'></small><noframes id='2HlUo'>

      1. <tfoot id='2HlUo'></tfoot>
        <legend id='2HlUo'><style id='2HlUo'><dir id='2HlUo'><q id='2HlUo'></q></dir></style></legend>
          <bdo id='2HlUo'></bdo><ul id='2HlUo'></ul>
      2. 流式传输 PDF 附件时如何强制使用另存为对话框

        How to force a Save As dialog when streaming a PDF attachment(流式传输 PDF 附件时如何强制使用另存为对话框)
          <i id='G0qlM'><tr id='G0qlM'><dt id='G0qlM'><q id='G0qlM'><span id='G0qlM'><b id='G0qlM'><form id='G0qlM'><ins id='G0qlM'></ins><ul id='G0qlM'></ul><sub id='G0qlM'></sub></form><legend id='G0qlM'></legend><bdo id='G0qlM'><pre id='G0qlM'><center id='G0qlM'></center></pre></bdo></b><th id='G0qlM'></th></span></q></dt></tr></i><div id='G0qlM'><tfoot id='G0qlM'></tfoot><dl id='G0qlM'><fieldset id='G0qlM'></fieldset></dl></div>
            <bdo id='G0qlM'></bdo><ul id='G0qlM'></ul>

            • <legend id='G0qlM'><style id='G0qlM'><dir id='G0qlM'><q id='G0qlM'></q></dir></style></legend>
            • <small id='G0qlM'></small><noframes id='G0qlM'>

              • <tfoot id='G0qlM'></tfoot>

                    <tbody id='G0qlM'></tbody>
                  本文介绍了流式传输 PDF 附件时如何强制使用另存为对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用以下代码将 pdf 流式传输到浏览器:

                  I am using the following code to stream a pdf to the browser:

                  header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
                  header("Pragma: public");
                  header("Content-type:application/pdf");
                  header("Content-Disposition:attachment;filename=file.pdf");
                  echo $pdf;
                  

                  工作正常,除了(无论如何在 Chrome 中)它只是保存文件file.pdf" - 它不会提示另存为对话框,因此我可以重命名文件,如果我选择的话.

                  Works fine, except (in Chrome anyhow) it just saves the file "file.pdf" - it does not prompt a Save As dialog so I can rename the file, if I choose.

                  我怀疑这可能是那些依赖于浏览器的事情之一,但是在流式传输 pdf 以供下载时,是否可以强制使用 php 标头的另存为对话框?

                  I suspect this may be one of those browser-dependent things, but is it possible to force a Save As dialog with the php headers when streaming a pdf for download?

                  感谢(提前)您的帮助

                  推荐答案

                  他们很可能 在下载之前询问每个文件的保存位置未选中(高级设置).如果是这种情况,您无能为力,因为这是他们的偏好.

                  They most likely have Ask where to save each file before downloading unchecked (Advanced Settings). If this is the case, there's nothing you can do as this is their preference.

                  这篇关于流式传输 PDF 附件时如何强制使用另存为对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                    1. <legend id='FDreg'><style id='FDreg'><dir id='FDreg'><q id='FDreg'></q></dir></style></legend>
                    2. <small id='FDreg'></small><noframes id='FDreg'>

                        • <bdo id='FDreg'></bdo><ul id='FDreg'></ul>
                          <tfoot id='FDreg'></tfoot>

                          1. <i id='FDreg'><tr id='FDreg'><dt id='FDreg'><q id='FDreg'><span id='FDreg'><b id='FDreg'><form id='FDreg'><ins id='FDreg'></ins><ul id='FDreg'></ul><sub id='FDreg'></sub></form><legend id='FDreg'></legend><bdo id='FDreg'><pre id='FDreg'><center id='FDreg'></center></pre></bdo></b><th id='FDreg'></th></span></q></dt></tr></i><div id='FDreg'><tfoot id='FDreg'></tfoot><dl id='FDreg'><fieldset id='FDreg'></fieldset></dl></div>
                              <tbody id='FDreg'></tbody>