PHP.nl

ftp_site

ftp_site

Sends a SITE command to the server

bool **ftp_site** FTP\Connection $ftp string $command
sends the given  

command to the FTP server. ftp_site``SITE

commands are not standardized, and vary from server

to server. They are useful for handling such things as file permissions and group membership. SITE

ftp``commandThe SITE command. Note that this parameter isn't escaped so there may be some issues with filenames containing spaces and other characters.

return.success

Voorbeeld: Sending a SITE command to an ftp server

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

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

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

ftp_raw