Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Server Side Programming Articles
Page 1058 of 2109
ftp_nb_continue() function in PHP
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 Moreftp_login() function in PHP
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 Moreftp_get_option() function in PHP
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 Moreftp_fput() function in PHP
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 Moreftp_fget() function in PHP
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 Moreftp_exec() function in PHP
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 Moreftp_connect() function in PHP
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 Moreftp_close() function in PHP
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 Moreftp_chmod() function in PHP
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 Moreftp_cdup() function in PHP
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