• <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>

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

        时间:2023-08-20

          • <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"');
                  

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

                  上一篇:创建一个 zip 文件并下载它 下一篇:一个让用户从我的网站下载文件而不泄露我网站中实际文件链接的 PHP 脚本?

                  相关文章

                  <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'>