1. <small id='LDJlw'></small><noframes id='LDJlw'>

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

        标题位置 + 内容配置

        Header Location + Content Disposition(标题位置 + 内容配置)
      1. <i id='z3LFB'><tr id='z3LFB'><dt id='z3LFB'><q id='z3LFB'><span id='z3LFB'><b id='z3LFB'><form id='z3LFB'><ins id='z3LFB'></ins><ul id='z3LFB'></ul><sub id='z3LFB'></sub></form><legend id='z3LFB'></legend><bdo id='z3LFB'><pre id='z3LFB'><center id='z3LFB'></center></pre></bdo></b><th id='z3LFB'></th></span></q></dt></tr></i><div id='z3LFB'><tfoot id='z3LFB'></tfoot><dl id='z3LFB'><fieldset id='z3LFB'></fieldset></dl></div>
        <tfoot id='z3LFB'></tfoot>

          <small id='z3LFB'></small><noframes id='z3LFB'>

            • <bdo id='z3LFB'></bdo><ul id='z3LFB'></ul>
                  <tbody id='z3LFB'></tbody>

                1. <legend id='z3LFB'><style id='z3LFB'><dir id='z3LFB'><q id='z3LFB'></q></dir></style></legend>

                2. 本文介绍了标题位置 + 内容配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  所以我有一个下载页面,你点击一个链接,它会打开/downloads/download/randomhash

                  So I have a downloads page where you click a link, it opens /downloads/download/randomhash

                  在数据库中找到随机哈希,我增加一个下载计数器,然后重定向到实际文件,例如/uploads/2012/file.png.

                  randomhash is found in the db, i increment a download counter, and then redirect to the actual file e.g. /uploads/2012/file.png.

                  一切正常,除了重定向做我想做的事.我不确定为什么它不起作用...

                  Everything works except for the redirect doing what I'd like it to do. I'm not sure why it's not working...

                    header("Location: " . $row->uri);
                    header("Content-Disposition: attachment; filename=$row->name");
                  

                  在第一次加载文件时,它具有适当的 content-disposition 标头(在 firebug 中),但它不会提示下载文件(它应该下载,对吗??).有什么想法吗?

                  On the first load of the file, it has the appropriate content-disposition header (in firebug), but it doesn't prompt the file to be downloaded (which it should, right??). Any ideas?

                  响应标头:

                  Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, public
                  Connection: Keep-Alive
                  Content-Disposition: attachment; filename=promotion_photo_2.jpg
                  Content-Encoding: gzip
                  Content-Length: 20
                  Content-Type: text/html; charset=utf-8
                  Date: Mon, 27 Feb 2012 01:01:22 GMT
                  Expires: Thu, 19 Nov 1981 08:52:00 GMT
                  Keep-Alive: timeout=5, max=100
                  Location: /uploads/2012/mediakitD3CF.jpg
                  Pragma: no-cache
                  Server: *
                  Vary: Accept-Encoding
                  X-Powered-By: *
                  X-UA-Compatible: IE=Edge,chrome=1
                  

                  推荐答案

                  您在相同的响应中设置 Content-Disposition 标头,告诉浏览器重定向到哪里.我的建议是只在响应中流式传输附件,没有重定向

                  You are setting the Content-Disposition header in the same response which tells the browser where to redirect. My suggestion is to just stream the attachment on the response, with no redirect

                  header('Content-Disposition: attachment; filename=file-to-be-downloaded.jpg');
                  header('Content-type: image/jpeg'); // or what is relevant, ie application/octet-stream
                  $fn=fopen("path-to-file/file-to-be-downloaded.jpg","r");
                  fpassthru($fn);
                  

                  这篇关于标题位置 + 内容配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 的问题)
                      <tbody id='Sjipo'></tbody>
                      <tfoot id='Sjipo'></tfoot>
                      <i id='Sjipo'><tr id='Sjipo'><dt id='Sjipo'><q id='Sjipo'><span id='Sjipo'><b id='Sjipo'><form id='Sjipo'><ins id='Sjipo'></ins><ul id='Sjipo'></ul><sub id='Sjipo'></sub></form><legend id='Sjipo'></legend><bdo id='Sjipo'><pre id='Sjipo'><center id='Sjipo'></center></pre></bdo></b><th id='Sjipo'></th></span></q></dt></tr></i><div id='Sjipo'><tfoot id='Sjipo'></tfoot><dl id='Sjipo'><fieldset id='Sjipo'></fieldset></dl></div>

                        • <bdo id='Sjipo'></bdo><ul id='Sjipo'></ul>

                          <legend id='Sjipo'><style id='Sjipo'><dir id='Sjipo'><q id='Sjipo'></q></dir></style></legend>

                            <small id='Sjipo'></small><noframes id='Sjipo'>