PHP ftp_site() Function

Definition and Usage

The ftp_site() function sends a SITE command to the server.

The SITE command is not standardized. Different servers may vary. The SITE command is very useful for handling file permissions or group relationships.

Syntax

ftp_site(ftp_connection,command)
Parameter Description
ftp_connection Required. Specifies the FTP connection to use (the identifier of the FTP connection).
command Required. Specifies the SITE command to send to FTP.

Description

The ftp_site() function sends a SITE command to the FTP server by the parameter command The specified command.

Returns true if successful, false if not.

Tips and Comments

Tip:To see which commands are available, please go through ftp_raw() The function sends the REMOTEHELP command.

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);
?>