Description
bool
ftp_site ( resource ftp_stream, string cmd)
ftp_site() sends the command specified by
cmd to the FTP server_ SITE commands
are not standardized, and vary from server to server_ They are
useful for handling such things as file permissions and group
membership_
Ejemplo 1_ Sending a SITE command to an ftp server <?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_');
}
?> |
|
Devuelve TRUE si todo se
llevó a cabo correctamente, FALSE en caso
de fallo_
See Also:
ftp_raw()