我试图从我的机器(客户端)上传一个文件到FileZilla服务器(服务器端)来存储网页文件。当试图通过PHP连接到FileZilla时,我会收到以下错误消息:
Connection failed: Connection refused通常,当登录凭据不正确时,我会期望错误,但是,在这种情况下,它们是正确的。
我的问题是:你能通过PHP连接到FileZilla吗?我相信答案肯定是“是”,但由于目前的技术困难,否则我不会感到惊讶。
连接函数的格式设置可能有错误。
var $host = "xx.xx.xx.xx";
var $user = "xx";
var $pass = "xx";
var $connect;
function serverConnection()
{
$conection = mysqli_connect($this->host, $this->user, $this->pass) or die
("Connection failed: " . mysqli_connect_error());
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
} else {
$this->connect = $conection;
}
return $this->connect;
}其目标是能够将文件从表单上传到FileZilla,充当用户配置图片的角色。
发布于 2018-10-28 13:06:08
https://stackoverflow.com/questions/53031755
复制相似问题