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
Programming Articles
Page 1071 of 2547
ftp_quit() function in PHP
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 Moreftp_pasv() function in PHP
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 Moreftp_nlist() function in PHP
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 Moreftp_nb_fput() function in PHP
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 Moreftp_nb_fget() function in PHP
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 Moreftp_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 More