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 uploaded
  • ftp_append — Append the contents of a file to another file on the FTP server
  • ftp_cdup — Changes to the parent directory
  • ftp_chdir — Changes the current directory on a FTP server
  • ftp_chmod — Set permissions on a file via FTP
  • ftp_close — Closes an FTP connection
  • ftp_connect — Opens an FTP connection
  • ftp_delete — Deletes a file on the FTP server
  • ftp_exec — Requests execution of a command on the FTP server
  • ftp_fget — Downloads a file from the FTP server and saves to an open file
  • ftp_fput — Uploads from an open file to the FTP server
  • ftp_get — Downloads a file from the FTP server
  • ftp_get_option — Retrieves various runtime behaviours of the current FTP connection
  • ftp_login — Logs in to an FTP connection
  • ftp_mdtm — Returns the last modified time of the given file
  • ftp_mkdir — Creates a directory
  • ftp_mlsd — Returns a list of files in the given directory
  • ftp_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 directory
  • ftp_pasv — Turns passive mode on or off
  • ftp_put — Uploads a file to the FTP server
  • ftp_pwd — Returns the current directory name
  • ftp_quit — Alias of ftp_close
  • ftp_raw — Sends an arbitrary command to an FTP server
  • ftp_rawlist — Returns a detailed list of files in the given directory
  • ftp_rename — Renames a file or a directory on the FTP server
  • ftp_rmdir — Removes a directory
  • ftp_set_option — Set miscellaneous runtime FTP options
  • ftp_site — Sends a SITE command to the server
  • ftp_size — Returns the size of the given file
  • ftp_ssl_connect — Opens a Secure SSL-FTP connection
  • ftp_systype — Returns the system type identifier of the remote FTP server

클래스 참조

  • FTP\Connection — The FTP\Connection class

더 알아보기

  • 비동기(논블로킹) 전송이 필요하면 ftp_nb_* 계열 함수가 있어요. 큰 파일을 내려받거나 올릴 때 특히 유용해요.
  • 보안 연결이 필요하면 ftp_ssl_connect()로 SSL-FTP 연결을 열 수 있어요.