FTP
FTP (File Transfer Protocol)
서버에 있는 파일을 FTP 프로토콜로 다루고 싶을 때 쓰는 확장이에요. RFC 959에 정의된 FTP를 구현해 FTP 서버에 대한 세밀한 클라이언트 접근을 제공해요. 단순히 FTP 서버의 파일을 읽거나 쓰는 게 목적이라면 ftp:// 래퍼를 파일시스템 함수와 함께 쓰는 게 더 간단하고 직관적이에요.
출처: FTP
본문
소개
이 확장의 함수들은 RFC 959(https://datatracker.ietf.org/doc/html/rfc959)에 정의된 FTP(File Transfer Protocol)를 말하는 파일 서버에 대한 클라이언트 접근을 구현해요. 실행 중인 스크립트에 폭넓은 제어권을 주는, FTP 서버에 대한 세밀한(detailed) 접근을 위한 확장이에요.
FTP 서버의 파일을 단지 읽거나 쓰기만 원한다면, 파일시스템 함수와 함께 ftp:// 래퍼를 쓰는 걸 고려해 보세요. 그쪽이 더 단순하고 직관적인 인터페이스를 제공해요.
함수 참조
FTP Functions
ftp_alloc— Allocates space for a file to be uploadedftp_append— Append the contents of a file to another file on the FTP serverftp_cdup— Changes to the parent directoryftp_chdir— Changes the current directory on a FTP serverftp_chmod— Set permissions on a file via FTPftp_close— Closes an FTP connectionftp_connect— Opens an FTP connectionftp_delete— Deletes a file on the FTP serverftp_exec— Requests execution of a command on the FTP serverftp_fget— Downloads a file from the FTP server and saves to an open fileftp_fput— Uploads from an open file to the FTP serverftp_get— Downloads a file from the FTP serverftp_get_option— Retrieves various runtime behaviours of the current FTP connectionftp_login— Logs in to an FTP connectionftp_mdtm— Returns the last modified time of the given fileftp_mkdir— Creates a directoryftp_mlsd— Returns a list of files in the given directoryftp_nb_continue— Continues retrieving/sending a file (non-blocking)ftp_nb_fget— Retrieves a file from the FTP server and writes it to an open file (non-blocking)ftp_nb_fput— Stores a file from an open file to the FTP server (non-blocking)ftp_nb_get— Retrieves a file from the FTP server and writes it to a local file (non-blocking)ftp_nb_put— Stores a file on the FTP server (non-blocking)ftp_nlist— Returns a list of files in the given directoryftp_pasv— Turns passive mode on or offftp_put— Uploads a file to the FTP serverftp_pwd— Returns the current directory nameftp_quit— Alias of ftp_closeftp_raw— Sends an arbitrary command to an FTP serverftp_rawlist— Returns a detailed list of files in the given directoryftp_rename— Renames a file or a directory on the FTP serverftp_rmdir— Removes a directoryftp_set_option— Set miscellaneous runtime FTP optionsftp_site— Sends a SITE command to the serverftp_size— Returns the size of the given fileftp_ssl_connect— Opens a Secure SSL-FTP connectionftp_systype— Returns the system type identifier of the remote FTP server
클래스 참조
FTP\Connection— The FTP\Connection class
더 알아보기
- 비동기(논블로킹) 전송이 필요하면
ftp_nb_*계열 함수가 있어요. 큰 파일을 내려받거나 올릴 때 특히 유용해요. - 보안 연결이 필요하면
ftp_ssl_connect()로 SSL-FTP 연결을 열 수 있어요.