• <i id='90iGs'><tr id='90iGs'><dt id='90iGs'><q id='90iGs'><span id='90iGs'><b id='90iGs'><form id='90iGs'><ins id='90iGs'></ins><ul id='90iGs'></ul><sub id='90iGs'></sub></form><legend id='90iGs'></legend><bdo id='90iGs'><pre id='90iGs'><center id='90iGs'></center></pre></bdo></b><th id='90iGs'></th></span></q></dt></tr></i><div id='90iGs'><tfoot id='90iGs'></tfoot><dl id='90iGs'><fieldset id='90iGs'></fieldset></dl></div>
    <tfoot id='90iGs'></tfoot>
  • <small id='90iGs'></small><noframes id='90iGs'>

  • <legend id='90iGs'><style id='90iGs'><dir id='90iGs'><q id='90iGs'></q></dir></style></legend>
      <bdo id='90iGs'></bdo><ul id='90iGs'></ul>

        下载与存储名称不同的文件

        Downloading a file with a different name to the stored name(下载与存储名称不同的文件)

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

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

                  <tfoot id='kWonC'></tfoot>
                1. <legend id='kWonC'><style id='kWonC'><dir id='kWonC'><q id='kWonC'></q></dir></style></legend>
                2. 本文介绍了下载与存储名称不同的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  是否可以让您的用户下载不同名称的文件?

                  Is it possible to let your user download a file with a different name?

                  比如有一个文件叫做4324ffsd34.jpg".我希望人们通过 download.php 下载它,使用不同的名称(如filetodownload.jpg"),而不重命名原始文件.

                  For example, there is a file called "4324ffsd34.jpg". I want people to download it via download.php, with a different name (like "filetodownload.jpg"), without renaming the original file.

                  推荐答案

                  当然,使用 Content-disposition 标题

                  Sure, use a Content-disposition header

                  header('Content-Disposition: attachment; filename="filetodownload.jpg"');
                  

                  如果您希望提供默认文件名,而不是自动下载,这似乎可行.

                  if you wish to provide a default filename, but not automatic download, this seems to work.

                  header('Content-Disposition: filename="filetodownload.jpg"');
                  

                  这篇关于下载与存储名称不同的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Is PHP or PHP based web framework stateful or stateless?(PHP 或基于 PHP 的 Web 框架是有状态的还是无状态的?)
                  How to parse django style template tags(如何解析 django 样式模板标签)
                  What is a good setup for editing PHP in Emacs?(在 Emacs 中编辑 PHP 的好设置是什么?)
                  How to check whether specified PID is currently running without invoking ps from PHP?(如何在不从 PHP 调用 ps 的情况下检查指定的 PID 当前是否正在运行?)
                  What#39;s the difference between escapeshellarg and escapeshellcmd?(escapeshellarg 和escapeshellcmd 有什么区别?)
                  php in background exec() function(php 后台 exec() 函数)
                  <i id='ACpO0'><tr id='ACpO0'><dt id='ACpO0'><q id='ACpO0'><span id='ACpO0'><b id='ACpO0'><form id='ACpO0'><ins id='ACpO0'></ins><ul id='ACpO0'></ul><sub id='ACpO0'></sub></form><legend id='ACpO0'></legend><bdo id='ACpO0'><pre id='ACpO0'><center id='ACpO0'></center></pre></bdo></b><th id='ACpO0'></th></span></q></dt></tr></i><div id='ACpO0'><tfoot id='ACpO0'></tfoot><dl id='ACpO0'><fieldset id='ACpO0'></fieldset></dl></div>

                        <bdo id='ACpO0'></bdo><ul id='ACpO0'></ul>
                        1. <tfoot id='ACpO0'></tfoot>

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

                            <tbody id='ACpO0'></tbody>