Articles on Trending Technologies

Technical articles with clear explanations and examples

ftp_site() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 121 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 156 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_raw() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 129 Views

The ftp_raw() function sends raw commands directly to the FTP server and returns the server's response. This gives you low-level control over FTP operations by allowing you to send any valid FTP protocol command. Syntax ftp_raw(connection, command) Parameters connection − The FTP connection resource created by ftp_connect() command − The raw FTP command to execute (without trailing CRLF) Return Value The ftp_raw() function returns the server's response as an array of strings, where each element represents a line of the server's response. Example The following example demonstrates sending ...

Read More

ftp_quit() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 159 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_pasv() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 195 Views

The ftp_pasv() function in PHP enables or disables passive mode for FTP connections. Passive mode allows the client to initiate data connections, which is often required when working behind firewalls or NAT routers. Syntax ftp_pasv(connection, pasv) Parameters connection − The FTP connection resource returned by ftp_connect() pasv − A boolean value that specifies the passive mode state − TRUE − Enable passive mode ...

Read More

ftp_nlist() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 146 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_fput() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 132 Views

The ftp_nb_fput() function uploads data from an open file pointer to a file on the FTP server using non-blocking mode. This allows your script to continue processing while the upload happens in the background. Syntax ftp_nb_fput(con, remote_file, open_file, transfer_mode, beg_pos); Parameters con − The FTP connection resource remote_file − The remote file path on the FTP server open_file − The file pointer resource opened with fopen() transfer_mode − The transfer mode. Possible values: − FTP_ASCII for text files − FTP_BINARY for binary files beg_pos − (Optional) The position to start uploading from ...

Read More

ftp_nb_fget() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 143 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_nb_continue() function in PHP

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 99 Views

The ftp_nb_continue() function continues to receive or send a file to the FTP server in non-blocking mode. This function is used with non-blocking FTP operations to check the status and continue the transfer process. Syntax ftp_nb_continue($ftp_connection); Parameters ftp_connection − The FTP connection resource created by ftp_connect(). Return Value The ftp_nb_continue() function returns one of the following constants − FTP_FAILED − The transfer failed FTP_FINISHED − The transfer completed successfully FTP_MOREDATA − The transfer is still in progress Example The following example shows how to use ...

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
Showing 22661–22670 of 61,297 articles
Advertisements