ftp_chmod
Set permissions on the file via FTP.
ftp_chmod()
function sets the permissions of the specified file on the FTP server.
If successful, the function returns a new permission. Otherwise, return false.
<?php $conn = ftp_connect ( "ftp.testftp.com" ) or die ( "Could not connect" ) ; ftp_login ( $conn , "user" , "pass" ) ; // The owner can read and write, and others do not have any permissions ftp_chmod ( $conn , "0600" , "test.txt" ) ; // The owner can read and write, and others can read ftp_chmod ( $conn , "0644" , "test.txt" ) ; // The owner has all permissions, which can be read and executed by others ftp_chmod ( $conn , "0755" , "test.txt" ) ; // The owner has all permissions, and the group to which the owner belongs can be readable ftp_chmod ( $conn , "0740" , "test.txt" ) ; ftp_close ( $conn ) ; ?>
ftp_chmod ( ftp_connection , mode , file )
parameter | describe |
---|---|
ftp_connection | Required. Specifies the FTP connection to be used (the identifier of the FTP connection). |
mode | Required. Specify new permissions. |
file | Required. Specifies the name of the file to be modified. |