<tfoot id='vkJZQ'></tfoot>

    <bdo id='vkJZQ'></bdo><ul id='vkJZQ'></ul>

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

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

      2. PHP:如何将上传的临时文件复制到多个地方?

        时间:2023-05-21

      3. <small id='nGbCZ'></small><noframes id='nGbCZ'>

      4. <tfoot id='nGbCZ'></tfoot>

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

              • <bdo id='nGbCZ'></bdo><ul id='nGbCZ'></ul>
                  <legend id='nGbCZ'><style id='nGbCZ'><dir id='nGbCZ'><q id='nGbCZ'></q></dir></style></legend>
                    <tbody id='nGbCZ'></tbody>
                  本文介绍了PHP:如何将上传的临时文件复制到多个地方?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  如何将同一个文件复制两次?我正在尝试做这样的事情:

                  how can I copy two times the same file? I'm trying to do something like this:

                                  copy($file['tmp_name'], $folder."1.jpg");
                              copy($file['tmp_name'], $folder."2.jpg");
                              copy($file['tmp_name'], $folder."3.jpg");
                  

                  临时文件在被服务器销毁之前有多少时间?

                  And how many time does temp files has before it's destroyed by the server?

                  我也尝试使用 move_uploaded_file,但我无法让它工作.我想从上传的文件中生成 2 个拇指.

                  I try using move_uploaded_file also, but I can't make it work. I want to generate 2 thumbs from an uploaded file.

                  需要帮助吗?

                  谢谢,

                  推荐答案

                  move_uploaded_file 将移动文件,而不是复制它——这意味着它只能工作一次.

                  move_uploaded_file will move the file, and not copy it -- which means it'll work only once.

                  如果你使用copy,应该没有任何限制完全取决于您可以复制的次数:上传创建的临时文件只会在脚本执行结束时被销毁(除非您之前移动/删除它,当然)


                  不过,也许解决方案是先使用 move_uploaded_file ,然后使用 copy ?
                  有点像,我想:


                  Still, maybe a solution would be to use move_uploaded_file first, and, then, copy ?
                  A bit like that, I suppose :

                  if (move_uploaded_file($file['tmp_name'], $folder . '1.jpg')) {
                      copy($folder . '1.jpg', $folder . '2.jpg');
                      copy($folder . '1.jpg', $folder . '3.jpg');
                  }
                  

                  这将允许您获得 move_uploaded_file...

                  This would allow you to get the checks provided by move_uploaded_file...


                  如果这不起作用,那么请确保:


                  If this doesn't work, then, make sure that :

                  • $folder 包含你想要的——包括最终的 /
                  • 那个$file['tmp_name'] 也包含你想要的(我猜这是$_FILES 的某种副本——make确保 $_FILES$file 的副本正确完成)
                  • $folder contains what you want -- including the final /
                  • That $file['tmp_name'] also contains what you want (I'm guessing this is some kind of copy of $_FILES -- make sure the copy of $_FILES to $file is done properly)

                  这篇关于PHP:如何将上传的临时文件复制到多个地方?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:文件上传;如何利用“分块"? 下一篇:我有哪些选项可以检查 PHP 上传中的病毒?

                  相关文章

                  最新文章

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

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

                    <legend id='LpUy7'><style id='LpUy7'><dir id='LpUy7'><q id='LpUy7'></q></dir></style></legend>
                    <tfoot id='LpUy7'></tfoot>