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

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

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

      1. ftp_put():无法打开那个文件:没有那个文件或目录

        ftp_put(): Can#39;t open that file: No such file or directory(ftp_put():无法打开那个文件:没有那个文件或目录)
            <tbody id='wR5Kh'></tbody>
              <bdo id='wR5Kh'></bdo><ul id='wR5Kh'></ul>
            • <small id='wR5Kh'></small><noframes id='wR5Kh'>

              • <legend id='wR5Kh'><style id='wR5Kh'><dir id='wR5Kh'><q id='wR5Kh'></q></dir></style></legend>
              • <tfoot id='wR5Kh'></tfoot>
                <i id='wR5Kh'><tr id='wR5Kh'><dt id='wR5Kh'><q id='wR5Kh'><span id='wR5Kh'><b id='wR5Kh'><form id='wR5Kh'><ins id='wR5Kh'></ins><ul id='wR5Kh'></ul><sub id='wR5Kh'></sub></form><legend id='wR5Kh'></legend><bdo id='wR5Kh'><pre id='wR5Kh'><center id='wR5Kh'></center></pre></bdo></b><th id='wR5Kh'></th></span></q></dt></tr></i><div id='wR5Kh'><tfoot id='wR5Kh'></tfoot><dl id='wR5Kh'><fieldset id='wR5Kh'></fieldset></dl></div>
                  本文介绍了ftp_put():无法打开那个文件:没有那个文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在互联网上搜索了很多,但我没有找到解决方案.我需要通过 PHP 将文件上传到 FTP 服务器.

                  I search a lot on internet but i don't find a solution. I need upload a file to an FTP server through PHP.

                  我在下面测试了各种 PHP 脚本,但总是遇到同样的问题(我尝试使用绝对路径、普通路径和其他路径):

                  I tested various script PHP like this below but I always receive the same problem (I tries with absolute, normal and other path):

                  已连接
                  警告:ftp_put():无法打开该文件:第 20 行的/web/htdocs/www.stanem.it/home/csv/importinnovacsv.php 中没有这样的文件或目录
                  上传/web/htdocs/www.stanem.it/home/csv/test.csv 时出现问题

                  connected
                  Warning: ftp_put(): Can't open that file: No such file or directory in /web/htdocs/www.stanem.it/home/csv/importinnovacsv.php on line 20
                  There was a problem while uploading /web/htdocs/www.stanem.it/home/csv/test.csv

                  我必须做什么?

                  <?php
                  $ftp_server="ftp.xxxx.it";
                  $ftp_user_name="user";
                  $ftp_user_pass="psw";
                  
                  // connect and login to FTP server
                  
                  $ftp_conn       = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
                  $login          = ftp_login($ftp_conn, $ftp_user_name, $ftp_user_pass);
                  
                  if($login) {
                     echo 'connected<br>'; 
                  
                     // Where I need to put file
                     $local_file = '/web/htdocs/www.stanem.it/home/csv/test.csv'; 
                     // Where I copy the file
                     $server_dir = 'ftp://15886:XDBbcFYQUs@ftp.innovaspa.it'; 
                  
                     // upload a file
                     if (ftp_put($ftp_conn, $server_dir, $local_file, FTP_ASCII)) {
                         echo "successfully uploaded $local_file
                  ";
                         exit;
                     } else {
                         echo "There was a problem while uploading $local_file
                  ";
                         exit;
                     }
                  } 
                  

                  推荐答案

                  $remote_file 参数.ftp-put.php" rel="nofollow noreferrer">ftp_put 是 FTP 服务器上 filepath.

                  The $remote_file argument of ftp_put is a path to the file on the FTP server.

                  您正在传递一个 URL(它甚至会遗漏任何路径或文件名).

                  You are passing a URL (and it even misses any path or file name).

                  应该是这样的:

                  $remote_file = "/remote/path/test.csv";
                  


                  一旦解决了路径问题,您也可能会遇到数据连接问题,因为您使用的是默认活动模式.请参阅 PHP ftp_put 失败.

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

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

                  相关文档推荐

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

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

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

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

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

                        <tfoot id='FnHRL'></tfoot>