<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 附件时如何强制使用另存为对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  PHP Upload File Validation(PHP 上传文件验证)
                  PHP Error - Uploading a file(PHP 错误 - 上传文件)
                  How can I write tests for file upload in PHP?(如何在 PHP 中编写文件上传测试?)
                  php resizing image on upload rotates the image when i don#39;t want it to(php在上传时调整图像大小会在我不想要它时旋转图像)
                  How to send additional data using PLupload?(如何使用 PLupload 发送附加数据?)
                  change button text in js/ajax after mp4 =gt;mp3 conversion in php(在 php 中的 mp4 =gt;mp3 转换后更改 js/ajax 中的按钮文本)

                    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>