|
|
The functions in this section allow you to make connections to FTP servers. FTP is the file transfer protocol. While the file functions allow you to open and manipulate remote files by specifying a URL instead of a local path, these functions operate directly with the FTP protocol. They offer a greater degree of control. They also allow you to get a list of files on the server. The FTP functions were added to PHP by Andrew Skalski.M. boolean ftp_cdup(integer link) The ftp_cdup function changes the working directory to the parent directory. boolean ftp_chdir(integer link, string directory) The ftp_chdir function moves the working directory to the specified directory. integer ftp_connect(string host, integer port) Use ftp_connect to begin an FTP connection. The port argument is optional. An FTP reso
The functions in this section allow you to make connections to FTP servers. FTP is the file transfer protocol. While the file functions allow you to open and manipulate remote files by specifying a URL instead of a local path, these functions operate directly with the FTP protocol. They offer a greater degree of control. They also allow you to get a list of files on the server. The FTP functions were added to PHP by Andrew Skalski.M.
boolean ftp_cdup(integer link)
The ftp_cdup function changes the working directory to the parent directory.
boolean ftp_chdir(integer link, string directory)
The ftp_chdir function moves the working directory to the specified directory.
integer ftp_connect(string host, integer port)
Use ftp_connect to begin an FTP connection. The port argument is optional. An FTP resource identifier will be returned if the connection is successful, FALSE otherwise. This D is used in the rest of the FTP commands. Remem- ber that once you connect, you must log in before you can issue any commands.
boolean ftp_delete(integer link, string path)
The ftp_delete function removes a file on the remote server. The link argument is as returned by ftp_connect. The path argument is the path on the remote server to the file to be deleted. See ftp_put for an example of use.
boolean ftp_fget(integer link, integer file, string filename, integer mode)
The ftp_fget function copies a remote file into an open file stream. You must create a file resource using fopen or a similar function to pass as the second argument. The mode argument should be set with one of two constants: FTP_ASCII or FTP_IMAGE. These are sometimes referred to as text or binary modes.
boolean ftp_fput(integer link, string remote, integer file, integer mode)
The ftp_fput function creates a file on the remote server from the contents of an open file stream. The link argument is as returned by ftp_connect. The remote argument is the path to the file to be created on the remote server. The file argument is a file identifier as returned by fopen or a similar function. The mode argument should be FTP_ASCII or FTP_IMAGE.
boolean ftp_get(integer link, string local, string remote, integer mode)
Use ftp_get to copy a file from the remote server to local filesystem. The link argument is as returned by ftp_connect. The local and remote arguments specify paths. The mode argument should use FTP_ASCII or FTP_IMAGE.
boolean ftp_login(integer link, string username, string password)
Once you make a connection to an FTP server, you must use ftp_login to identify yourself. All three arguments are required, even if you are logging in anonymously. See ftp_connect for an example of use.
integer ftp_mdtm(integer link, string path)
The ftp_mdtm function returns the last modification time for the file named in the path argument.
string ftp_mkdir(integer link, string directory)
The ftp_mkdir function creates a directory on the remote server. FALSE is returned if the directory cannot be created.
array ftp_nlist(integer link, string directory)
The ftp_nlist function returns an array of files in the specified directory.
boolean ftp_pasv(integer link, boolean on)
Use ftp_pasv to turn passive mode on or off. It is off by default.
boolean ftp_put(integer link, string remote, string local, integer mode)
The ftp_put function copies a file from the local filesystem to the remote server. The link argument is as returned by ftp_connect. The local and remote arguments specify paths. The mode argument should be either FTP_ASCII or FTP_IMAGE.
string ftp_pwd(integer link)
The ftp_pwd function returns the name of the current directory. See ftp_connect for an example of use.
boolean ftp_quit(integer link)
Use ftp_quit to close an FTP connection.
array ftp_rawlist(integer link, string directory)
The ftp_rawlist returns the raw output of an ls -l command on the given directory.
boolean ftp_rename(integer link, string original, string new)
The ftp_rename function changes the name of a file on the remote server.
boolean ftp_rmdir(integer link, string directory)
Use ftp_rmdir to remove a directory.
integer ftp_size(integer link, string path)
The ftp_size function returns the size of a remote file in bytes. If an error occurs, -1 is returned.
string ftp_systype(integer link)
The ftp_systype function returns the system type of the remote FTP server.
|
|
PHP Related Tutorials |
|
---|---|
MySQL Tutorial | Drupal Tutorial |
WordPress Tutorial | Joomla Tutorial |
CakePHP Tutorial | CodeIgniter Tutorial |
PHP7 Tutorial |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.