PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<ftp_set_optionftp_size>
Last updated: Mon, 16 Jul 2012

ftp_site

(PHP 3 >= 3.0.15, PHP 4, PHP 5)

ftp_site -- 向服务器发送 SITE 命令

说明

bool ftp_site ( resource ftp_stream, string cmd )

ftp_site() 函数向 FTP 服务器发送由参数 cmd 指定的命令。SITE 命令是非标准化的,不同的服务器不尽相同。主要用于处理文件权限以及组成员等事情。

例子 1. 向一个 FTP 服务器发送一条 SITE 命令

<?php
/* Connect to FTP server */
$conn = ftp_connect('ftp.example.com');
if (!
$conn) die('Unable to connect to ftp.example.com');

/* Login as "user" with password "pass" */
if (!ftp_login($conn, 'user', 'pass')) die('Error logging into ftp.example.com');

/* Issue: "SITE CHMOD 0600 /home/user/privatefile" command to ftp server */
if (ftp_site($conn, 'CHMOD 0600 /home/user/privatefile')) {
   echo
"Command executed successfully.\n";
} else {
   die(
'Command failed.');
}
?>

如果成功则返回 TRUE,失败则返回 FALSE

参见 ftp_raw()




<ftp_set_optionftp_size>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST