PHPFTP function usage tutorial. PHPFTP function using php ftp introduced in the tutorial this function provides the FTP client to access the file server through the file transfer protocol (FTP ). This FTP function is used to open, login name and password php ftp function usage tutorial
The FTP of the introduced PHP
The FTP client provided by this function accesses the file server through the File Transfer Protocol (FTP ).
This FTP function is used to open, closely connect the login name with, and upload, download, rename, delete, and retrieve information files from the file server. Not all FTP functions will return the same results as each server. The FTP function can be used with PHP 3.
These functions are used to access the FTP server in detail. If you only want to read or write files on the FTP server, you can use the encapsulated ftp: // and file functions.
Install
The Windows version of PHP has built-in support for FTP extension. Therefore, the FTP function will automatically work.
However, if you are running Linux PHP, you will have to compile PHP-enable-f tp (P HP4 +) or the f t p function obtained by-wi th-f t p (p h P3.
FTP functions in PHP
PHP: displays the earliest PHP version and supported functions.
Function |
Description |
PHP |
Ftp_alloc () |
Allocates space for a file to be uploaded to the FTP server |
5 |
Ftp_cdup () |
Changes the current directory to the parent directory on the FTP server |
3 |
Ftp_chdir () |
Changes the current directory on the FTP server |
3 |
Ftp_chmod () |
Sets permissions on a file via FTP |
5 |
Ftp_close () |
Closes an FTP connection |
4 |
Ftp_connect () |
Opens an FTP connection |
3 |
Ftp_delete () |
Deletes a file on the FTP server |
3 |
Ftp_exec () |
Executes a program/command on the FTP server |
4 |
Ftp_fget () |
Downloads a file from the FTP server and saves it to an open file |
3 |
Ftp_fput () |
Uploads from an open file and saves it to a file on the FTP server |
3 |
Ftp_get_option () |
Returns runtime behaviors of the FTP connection |
4 |
Ftp_get () |
Downloads a file from the FTP server |
3 |
Ftp_login () |
Logs on to an FTP connection |
3 |
Ftp_mdtm () |
Returns the last modified time of a specified file |
3 |
Ftp_mkdir () |
Creates a new directory on the FTP server |
3 |
Ftp_nb_continue () |
Continues retrieving/sending a file (non-blocking) |
4 |
Ftp_nb_fget () |
Downloads a file from the FTP server and saves it to an open file (non-blocking) |
4 |
Ftp_nb_fput () |
Uploads from an open file and saves it to a file on the FTP server (non-blocking) |
4 |
Ftp_nb_get () |
Downloads a file from the FTP server (non-blocking) |
4 |
Ftp_nb_put () |
Uploads a file to the FTP server (non-blocking) |
4 |
Ftp_nlist () |
Lists the files in a specified directory on the FTP server |
3 |
Ftp_pasv () |
Turns passive mode on or off |
3 |
Ftp_put () |
Uploads a file to the FTP server |
3 |
Ftp_pwd () |
Returns the current directory name |
3 |
Ftp_quit () |
Alias of ftp_close () |
3 |
Ftp_raw () |
Sends a raw command to the FTP server |
5 |
Ftp_rawlist () |
Returns a detailed list of files in the specified directory |
3 |
Ftp_rename () |
Renames a file or directory on the FTP server |
3 |
Ftp_rmdir () |
Removes a directory on the FTP server |
3 |
Ftp_set_option () |
Sets runtime options for the FTP connection |
4 |
Ftp_site () |
Sends a SITE command to the server |
3 |
Ftp_size () |
Returns the size of the specified file |
3 |
Ftp_ssl_connect () |
Opens a secure SSL-FTP connection |
4 |
Ftp_cmdype () |
Returns the system type identifier of the FTP server |
3 |
Php ftp Constants
PHP: Indicates the earliest version of PHP that supports the constant.
Constant |
Description |
PHP |
FTP_ASCII |
|
3 |
FTP_TEXT |
|
3 |
FTP_BINARY |
|
3 |
FTP_IMAGE |
|
3 |
FTP_TIMEOUT_SEC |
|
3 |
FTP_AUTOSEEK |
|
4 |
FTP_AUTORESUME |
Determine resume position and start position for get and put requests automatically |
4 |
FTP_FAILED |
Asynchronous transfer has failed |
4 |
FTP_FINISHED |
Asynchronous transfer has finished |
4 |
FTP_MOREDATA |
Asynchronous transfer is still active |
4 |
Http://www.bkjia.com/PHPjc/630491.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/630491.htmlTechArticlePHP FTP functions use php ftp introduced in tutorials This feature provides FTP clients to access file servers through File Transfer Protocol (FTP ). This FTP function is used to open, login name and password...