Php 在Codeigniter中通过ftp上传图像url

Php 在Codeigniter中通过ftp上传图像url,php,codeigniter,ftp,Php,Codeigniter,Ftp,我想通过输入url上传图像,并通过ftp将其存储到数据库中,但它显示了一个错误 找不到源文件。请检查您的路径 我如何解决这个问题?您正在使用第1970个ftp协议?认真地你的证件完全没有保护?你知道的。。。现在是2020年…请查看$fileName和$source的值。确保他们正在解析服务器上实际存在的文件。您正在使用第1970个ftp协议吗?认真地你的证件完全没有保护?你知道的。。。现在是2020年…请查看$fileName和$source的值。确保他们正在解析服务器上实际存在的文件。 if

我想通过输入url上传图像,并通过ftp将其存储到数据库中,但它显示了一个错误

找不到源文件。请检查您的路径


我如何解决这个问题?

您正在使用第1970个
ftp
协议?认真地你的证件完全没有保护?你知道的。。。现在是2020年…请查看$fileName和$source的值。确保他们正在解析服务器上实际存在的文件。您正在使用第1970个
ftp
协议吗?认真地你的证件完全没有保护?你知道的。。。现在是2020年…请查看$fileName和$source的值。确保他们正在解析服务器上实际存在的文件。
 if($this->input->post('submit')){
            //Upload to the local server
            $config['upload_path'] = './images/';
            $config['allowed_types'] = '*';
            $this->load->library('upload', $config);


            if($this->upload->do_upload('image'))
            {

                //Get uploaded file information
                $upload_data = $this->upload->data();
                $fileName = $upload_data['file_name'];

                //File path at local server
                $source = "uploads/".$fileName;

                //Load codeigniter FTP class
                $this->load->library('ftp');

                //FTP configuration
                $ftp_config['hostname'] = 'xxxxx'; 
                $ftp_config['username'] = 'xxxxx';
                $ftp_config['password'] = 'xxxxx';
                $ftp_config['debug']    = TRUE;

                //Connect to the remote server
                $this->ftp->connect($ftp_config);

                //File upload path of remote server
                $destination = '/assets/'.$fileName;
                echo $destination;

                //Upload file to the remote server
                $this->ftp->upload($source, ".".$destination);

                //Close FTP connection
                $this->ftp->close();

                //Delete file from local server
                @unlink($source);

            }
        }