最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
PHP写的FTP类
时间:2022-07-02 09:31:45 编辑:袖梨 来源:一聚教程网
class myftp {
var $connector;
var $getback;
function connect($ftp_server, $uname, $passwd){
// Baut grundlegende FTP Connection auf
$this->connector = @ftp_connect($ftp_server);
$this->login_result = @ftp_login($this->connector, "$uname", "$passwd");
if ((!$this->connector) ││ (!$this->login_result))
{
echo "FTP connection has failed! n";
echo "Attempted to connect to $ftp_server for user $uname n";
die;
} else {
echo "Connected to $ftp_server, for user $uname n";
}
}
function lastmodtime($value){
$getback = ftp_mdtm ($this->connector,$value);
return $getback;
}
function changedir($targetdir){
$getback = ftp_chdir($this->connector, $targetdir);
return $getback;
}
function getdir(){
$getback = ftp_pwd($this->connector);
return $getback;
}
function get_file_list($directory){
$getback = ftp_nlist($this->connector, $directory);
return $getback;
}
function get_file($file_to_get, $mode, $mode2){
$realfile = basename($file_to_get);
$filename = $realfile;
$checkdir = @$this->changedir($realfile);
if ($checkdir == TRUE){
ftp_cdup($this->connector);
echo "n[DIR] $realfile";
}else{
echo "..... ". $realfile ."n";
$getback = ftp_get($this->connector, $filename, $realfile, $mode);
if ($mode2){
$delstatus = ftp_delete($this->connector, $file_to_get);
if ($delstatus == TRUE){
echo "File $realfile on $host deleted n";
}
}
}
return $getback;
}
相关文章
- 人们熟悉的寄居蟹属于以下哪种分类 神奇海洋11月21日答案 11-21
- 第五人格11.22共研服有什么更新 11月22日共研服更新内容介绍 11-21
- 原神恰斯卡怎么培养 11-21
- 无期迷途四星装束是谁 11-21
- 王者荣耀帝丹高中校服怎么获得 11-21
- 光遇姆明季后续版本怎么玩 11-21