Function | Description |
ftp_cdup($connect) | Changes to the directory directly above the current directory. |
ftp_chdir($connect, ” directoryname ”)
| Changes directories on the remote computer. |
ftp_close($connect) | Closes an FTP connection. |
ftp_connect(“ servername ”) | Opens a connection to the computer (servername can be a domain name or an IP address). |
ftp_delete($connect, path/filename ”) | Deletes a file on the remote computer. |
ftp_exec($connect, ” command ”) | Executes a system command on the remote computer. |
ftp_fget($connect,$fh, ”data.txt”,FTP_ASCII) | Downloads the file contents from the remote computer ($fh is the file handle of the open file). |
ftp_fput($connect ,”new.txt”,$fh,FTP_ASCII) | $fh is the file handle of the open file. |
ftp_get($connect,”d.txt”, ”sr.txt”,FTP_ASCII) | Downloads a file from the remote computer (sr.txt is the name of the file to be downloaded, and d.txt is the name of the downloaded file). |
ftp_login($connect, $userID,$password) | Logs into the FTP server. |
ftp_mdtm($connect, ”filename.txt”) | Gets the time when the file was last modified. |
ftp_mkdir($connect, ” directoryname ”) | Creates a new directory on the remote computer. |
ftp_nlist($connect , ” directoryname ”) | Gets a list of the files in a remote directory. Files are returned in an array. |
ftp_put($connect,”d.txt”, ”sr.txt”,FTP_ASCII) | Uploads a file to the remote computer (sr.txt is the name of the file to be uploaded, and d.txt is the filename on the remote computer). |
ftp_pwd($connect) | Gets the name of the current directory on the remote computer. |