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

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

        • <bdo id='BNywS'></bdo><ul id='BNywS'></ul>
        <tfoot id='BNywS'></tfoot>

      2. PHP 警告:ftp_fput():无法打开该文件:是一个目录

        PHP Warning: ftp_fput(): Can#39;t open that file: Is a directory in(PHP 警告:ftp_fput():无法打开该文件:是一个目录)
        <i id='foht5'><tr id='foht5'><dt id='foht5'><q id='foht5'><span id='foht5'><b id='foht5'><form id='foht5'><ins id='foht5'></ins><ul id='foht5'></ul><sub id='foht5'></sub></form><legend id='foht5'></legend><bdo id='foht5'><pre id='foht5'><center id='foht5'></center></pre></bdo></b><th id='foht5'></th></span></q></dt></tr></i><div id='foht5'><tfoot id='foht5'></tfoot><dl id='foht5'><fieldset id='foht5'></fieldset></dl></div>

          <legend id='foht5'><style id='foht5'><dir id='foht5'><q id='foht5'></q></dir></style></legend>
            <tbody id='foht5'></tbody>
        1. <tfoot id='foht5'></tfoot>

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

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

                1. 本文介绍了PHP 警告:ftp_fput():无法打开该文件:是一个目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试将文件上传到 FTP.

                  I'm trying to upload a file to FTP.

                  这是我的代码:

                  $connect = ftp_connect('ftp.my-server.fr');
                  $login = ftp_login($connect, 'username', 'pass');
                  
                  $remote_file = '/' . $date;
                  $local_file = fopen('C:/MAMP/htdocs/mysite/myfolder/' . $hour .'.mp3', 'r');
                  
                  ftp_chdir($connect, '/'.$date);
                  
                  if (ftp_fput($connect, $remote_file, $local_file, FTP_ASCII)) {
                      echo "The file $local_file has been loaded";
                  } else {
                      echo "Error while uploading file " . $local_file;
                  }
                  

                  我收到一个错误:

                  PHP 警告:ftp_fput():无法打开该文件:是第 26 行 C:MAMPhtdocsmysiteindex.php 中的目录

                  PHP Warning: ftp_fput(): Can't open that file: Is a directory in C:MAMPhtdocsmysiteindex.php on line 26

                  我不明白,因为路径是文件.当我在浏览器中粘贴 $local_file URL 时,声音正在播放.

                  I don't understand because the path is the file. When I paste $local_file URL in my browser the sound is playing.

                  推荐答案

                  你的 $local_file 是可以的,但是你的 $remote_file 是一个目录(你使用 '/' . $date for ftp_chdir),它需要是一个文件的路径(将被创建)

                  Your $local_file is OK, but your $remote_file is a directory (you use '/' . $date for ftp_chdir), and it need to be a path to a file (that will be created)

                  您可以使用 basename 复制与本地文件相同的文件名:

                  You can copy the same filename than the local file with basename :

                  $remote_dir = '/' . $date;
                  $local_file = fopen('C:/MAMP/htdocs/mysite/myfolder/' . $hour .'.mp3', 'r');
                  
                  ftp_chdir($connect, $remote_dir);
                  $remote_file = $remote_dir . '/' . basename($local_file) ;
                  
                  if (ftp_fput($connect, $remote_file, $local_file, FTP_ASCII)) {
                      echo "The file $local_file has been loaded";
                  } else {
                       echo "Error while uploading file " . $local_file;
                  }
                  

                  这篇关于PHP 警告:ftp_fput():无法打开该文件:是一个目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 的问题)

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

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

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

                        • <bdo id='UvslJ'></bdo><ul id='UvslJ'></ul>
                          <tfoot id='UvslJ'></tfoot>
                              <tbody id='UvslJ'></tbody>