【发布时间】:2020-11-17 02:59:29
【问题描述】:
ftp_stream
The link identifier of the FTP connection.
remote_file
The remote file path.
local_file
The local file path.
mode
The transfer mode. Must be either FTP_ASCII or FTP_BINARY.
startpos
The position in the remote file to start uploading to.
https://www.php.net/manual/en/function.ftp-put.php
我仍然难以理解该链接中的许多内容。
问题:
$upload = ftp_put($newconn->conn,$destination,$source, FTP_BINARY);
实际的目的地和来源是什么?
$destination 是远程文件,$source 只是文件?
如果我们想把上传的内容放到某个文件夹中。我们必须开始pos吗 位置作为该文件夹位置?
更新:
我正在使用这个:
$filename = "message.txt";
$source = getcwd()."/".$filename;
echo "The source file path is: ". $source;
echo "<br />";
$destination=getcwd()."/"."ftpsend/";
echo "The destination file path is: ". $destination;
echo "<br />";
$upload = ftp_put($newconn->conn,$destination,$source, FTP_BINARY);
我收到此错误:
【问题讨论】: