Chinaunix首页 | 论坛 | 博客
  • 博客访问: 559933
  • 博文数量: 34
  • 博客积分: 10171
  • 博客等级: 上将
  • 技术积分: 1365
  • 用 户 组: 普通用户
  • 注册时间: 2004-11-09 13:13
文章分类

全部博文(34)

文章存档

2011年(1)

2009年(20)

2008年(13)

我的朋友

分类:

2009-06-03 17:14:06

<?
$ftp_server = "10.*.*.*";
$ftp_user_name = ""; //用户名
$ftp_user_pass = ""; //密码
if ($conn_id = ftp_connect($ftp_server)) //连接

{
    if (@ftp_login($conn_id, $ftp_user_name, $ftp_user_pass)) //登陆

    {
        if (@ftp_put($conn_id, basename($xls_file_name), $xls_file_name, FTP_BINARY)) //上传文件

        {
            if (@!ftp_put($conn_id, basename($tar_file), $tar_file, FTP_BINARY))
            {
                @ftp_delete($conn_id, basename($xls_file_name));
                $err_str = "FTP upload data has failed!";
            }
        }
        else
        {
            $err_str = "FTP upload XML has failed!";
        }
    }
    else
    {
        $err_str = "Attempted to connect to ".$ftp_server." for user ".$ftp_user_name." failed!";
    }
    @ftp_close($conn_id);
}
else
{
    $err_str = "FTP connection has failed!";
}
?>

阅读(561) | 评论(0) | 转发(0) |
0

上一篇:点击复制

下一篇:php soap方式发送

给主人留下些什么吧!~~