PHP ftp_site()Functions
Complete PHP FTP Reference
Definition and Usage
The ftp_site() function sends a SITE command to the FTP server.
The SITE command is not standardized and differs from server to server. The SITE command is useful for things such as handling file permissions or group relationships.
If successful, this function returns TRUE. If it fails, it returns FALSE and a warning.
Syntax
ftp_site(ftp_connection,command)
| Parameter | Description |
|---|---|
| ftp_connection | Required. Specifies the FTP connection to use. |
| command | Required. Specifies the SITE command to send to the FTP server. |
Tips and Notes
Tip:To see which commands are available, send the REMOTEHELP command via the ftp_raw() function.
Example
<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
ftp_site($conn,"CHMOD 0600 sitetest.txt");
ftp_close($conn);
?>
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
ftp_site($conn,"CHMOD 0600 sitetest.txt");
ftp_close($conn);
?>
Complete PHP FTP Reference Other Extensions