Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP ftp_chmod() Function

PHP ftp_chmod() Function


PHP FTP Reference Manual Complete PHP FTP Reference Manual


Definition and Usage

The ftp_chmod() function sets the permissions of a specified file on the FTP server.

Returns the new permissions on success, or FALSE with a warning on failure.

Syntax

ftp_chmod(ftp_connection,mode,file)

Parameters Description
ftp_connection Required. Specifies the FTP connection to use.
mode Required. Specifies the new permissions.

The mode parameter consists of 4 digits:

  • The first digit is usually 0
  • The second digit specifies the owner's permissions
  • The third digit specifies the permissions of the owner's user group
  • The fourth digit specifies the permissions for everyone else
  • Possible values (to set multiple permissions, add the numbers below together):

    | | file | Required. Specifies the name of the file whose permissions are to be changed. |

    Example


    PHP FTP Reference Manual Complete PHP FTP Reference Manual