Articles on Trending Technologies

Technical articles with clear explanations and examples

Tutorix - AI Tutor

ftp_login() function in PHP

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

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

The ftp_get_option() function retrieves runtime configuration options for an established FTP connection, allowing you to check current settings like timeout values and autoseek behavior. Syntax ftp_get_option(connection, option); Parameters connection − The FTP connection resource returned by ftp_connect(). option − The runtime option to retrieve. Available constants: FTP_TIMEOUT_SEC − Returns the current network timeout in seconds FTP_AUTOSEEK − Returns TRUE if autoseek is enabled, FALSE otherwise Return Value Returns the option value on success, or FALSE if the specified option is not supported or the connection is invalid. ...

Read More

ftp_fput() function in PHP

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

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

The ftp_fget() function downloads a file from an FTP server and saves it directly into an open local file resource. This function is useful when you need to download files from a remote FTP server and store them locally. Syntax ftp_fget(con, open_file, server_file, mode, startpos); Parameters con − The FTP connection resource created by ftp_connect() open_file − An open file resource where the downloaded data will be stored server_file − The path to the file on the FTP server to download mode − The transfer mode (FTP_ASCII or FTP_BINARY) startpos − The position ...

Read More

ftp_exec() function in PHP

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

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

The ftp_close() function in PHP is used to close an active FTP connection that was previously established using ftp_connect(). This function helps free up system resources and properly terminates the connection. Syntax ftp_close($connection); Parameters $connection − The FTP connection resource to close, returned by ftp_connect(). Return Value The ftp_close() function returns TRUE on success or FALSE on failure. Example The following example demonstrates connecting to an FTP server, performing directory operations, and properly closing the connection − Key Points Always close ...

Read More

ftp_chmod() function in PHP

Samual Sam
Samual Sam
Updated on 15-Mar-2026 198 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

ftp_cdup() function in PHP

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

The ftp_cdup() function in PHP changes the current directory to the parent directory on an FTP server. This is equivalent to the "cd .." command in Unix/Linux systems or "cd .." in Windows command prompt. Syntax ftp_cdup($ftp_connection) Parameters The function accepts the following parameter − ftp_connection − Required. The FTP connection resource returned by ftp_connect() Return Value The ftp_cdup() function returns TRUE on success or FALSE on failure. Example The following example demonstrates how to change the current directory to the parent directory − ...

Read More

ftp_alloc() function in PHP

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

The ftp_alloc() function allocates space for a file to be uploaded to the FTP server. This function is useful when uploading large files to ensure sufficient disk space is available on the server before attempting the transfer. Syntax ftp_alloc(connection, size_of_file, res); Parameters connection − The FTP connection resource to use size_of_file − The number of bytes to allocate on the server res − Optional variable to store the server response message Return Value The ftp_alloc() function returns TRUE on success or FALSE on failure. Example The following example ...

Read More
Showing 22671–22680 of 61,297 articles
Advertisements