php 模仿ftp文件上传实例
2013-09-05 19:24
731 查看
$mymode = FTP_ASCII;
$delete = 0;
$local_dir = "/my_local_download_directory";
$host = "ftp.yahoo.de";
$remote_dir = ".";
$anonymous = 0;
$user = "myusername";
核心代码
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(){
// Liefert Directory Namen zur
$delete = 0;
$local_dir = "/my_local_download_directory";
$host = "ftp.yahoo.de";
$remote_dir = ".";
$anonymous = 0;
$user = "myusername";
核心代码
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(){
// Liefert Directory Namen zur
相关文章推荐
- php下连接ftp实现文件的上传、下载、删除文件实例代码
- php下连接ftp实现文件的上传、下载、删除文件实例代码
- PHP中FTP上传文件和下载文件实例代码
- php文件包含+伪协议+文件上传漏洞利用实例
- PHP结合jQuery插件ajaxFileUpload实现异步上传文件实例
- PHP多个文件上传到服务器实例
- php文件上传的简单实例
- ftp文件上传实例
- PHP文件上传实例详解!!!
- (实用篇)PHP ftp上传文件操作类
- ****使用ftp软件上传下载php文件时换行符丢失bug
- PHP文件上传实例详解!!!
- PHP文件上传操作实例详解(包含上传文件类型MIME验证)
- php使用ftp远程上传文件类(完美解决主从文件同步问题的方法)
- PHP多个文件上传到服务器实例
- PHP5.0~5.6 各版本兼容性cURL文件上传功能实例分析
- PHP程序上传文件时,想指定上传到另一台服务器,php-ftp_connect
- PHP学习实例—3(文件的上传与下载)
- python实现的简单FTP上传下载文件实例
- java上传FTP文件实例程序