Samual Sam

Samual Sam

1,507 Articles Published

Articles by Samual Sam

Page 55 of 151

ftp_site() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 120 Views

The ftp_site() function sends an FTP SITE command to the FTP server. These commands are server-specific and handle OS features like file permissions and group membership. Syntax ftp_site(conn, command); Parameters conn − The FTP connection resource returned by ftp_connect() command − The SITE command string. These commands vary from server to server and are used for handling OS specific features such as file permissions and group membership Return Value The ftp_site() function returns TRUE on success or FALSE on failure. Example The following example demonstrates changing file permissions ...

Read More

ftp_rawlist() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 154 Views

The ftp_rawlist() function displays the list of files with file information from a specified directory on an FTP server. Unlike ftp_nlist(), it returns detailed file information including permissions, size, and modification date. Syntax ftp_rawlist(connection, directory, recursive); Parameters connection − Required. The FTP connection identifier. directory − Required. The directory path to list files from. recursive − Optional. Set to TRUE to enable recursive listing. Default is FALSE. Return Value The ftp_rawlist() function returns an array where each element corresponds to one line of text containing detailed file information. Returns FALSE ...

Read More

ftp_quit() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 158 Views

The ftp_quit() function in PHP is an alias to ftp_close(). It closes an FTP connection and cleans up resources associated with the connection. Syntax ftp_quit(connection); Parameters connection − The FTP connection resource to close. Return Value The ftp_quit() function returns TRUE on success or FALSE on failure. Example The following example demonstrates connecting to an FTP server, performing some operations, and then properly closing the connection − Connected successfully Current directory: /demo Directory changed! Current directory: / Connection closed successfully ...

Read More

ftp_nlist() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 143 Views

The ftp_nlist() function returns a list of files in the specified directory on the FTP server. It provides a simple way to retrieve file names without detailed information like file sizes or permissions. Syntax ftp_nlist(con, dir); Parameters con − The FTP connection resource created by ftp_connect() dir − The directory path to be listed. Use "." for current directory Return Value The ftp_nlist() function returns an array of file names on success or FALSE on failure. Example The following example demonstrates how to get the list of files ...

Read More

ftp_nb_fget() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 141 Views

The ftp_nb_fget() function downloads a file from the FTP server and saves it into an open file pointer. The "nb" stands for "non-blocking", meaning the function can be executed in steps to avoid blocking the script during large file transfers. Syntax ftp_nb_fget(con, open_file, server_file, transfer_mode, beg_pos); Parameters con − The FTP connection resource open_file − The open file pointer where local data ...

Read More

ftp_login() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 181 Views

The ftp_login() function in PHP is used to authenticate a user on an established FTP connection. It must be called after ftp_connect() to log in with valid credentials. Syntax ftp_login(connection, username, password) Parameters connection − The FTP connection resource returned by ftp_connect() username − The FTP username for authentication password − The FTP password for authentication Return Value The ftp_login() function returns TRUE on successful login or FALSE on failure. A warning is also generated on failure. Example The following example demonstrates how to establish an FTP connection ...

Read More

ftp_fput() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 231 Views

The ftp_fput() function is used to upload from an open file and saves it to a file on the FTP server. This function reads data from an already opened local file resource and transfers it to a remote file on the FTP server. Syntax ftp_fput(connection, remote_file, file_pointer, mode, startpos); Parameters connection − The FTP connection resource remote_file − The remote file path to upload to file_pointer − An already opened local file resource mode − The transfer mode (FTP_ASCII or FTP_BINARY) startpos − Optional. The position to begin uploading from (default is 0) ...

Read More

ftp_exec() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 293 Views

The ftp_exec() function is used to execute a command on the FTP server. This function is useful when you need to run server-side commands remotely through an FTP connection. Syntax ftp_exec(connection, command) Parameters connection − Required. The FTP connection resource created by ftp_connect() command − Required. The command string to execute on the FTP server Return Value The ftp_exec() function returns TRUE if the command was executed successfully, otherwise FALSE on failure. Example The following example demonstrates how to execute a command on an FTP server ?

Read More

ftp_connect() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 533 Views

The ftp_connect() function opens an FTP connection to a remote server. This function is essential for establishing FTP communication before performing file operations like upload, download, or directory management. Syntax ftp_connect(host, port, timeout); Parameters host − The FTP server to connect to. Can be a domain name or IP address. port − The port of the FTP server. Default is 21 for standard FTP connections. timeout − The timeout in seconds for network operations. Default is 90 seconds. Return Value The ftp_connect() function returns an FTP stream resource on success ...

Read More

ftp_chmod() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 186 Views

The ftp_chmod() function sets permissions on a remote file via FTP. This function allows you to modify file permissions on an FTP server using octal notation, similar to the Unix chmod command. Syntax ftp_chmod(connection, mode, filename) Parameters connection − Required. The FTP connection resource mode − Required. The new permissions in octal format It consists of four digits − ...

Read More
Showing 541–550 of 1,507 articles
« Prev 1 53 54 55 56 57 151 Next »
Advertisements