PHP Manual
Prev | Appendix I. List of Supported Protocols/Wrappers | Next

# FTP and FTPS

PHP 3, PHP 4. `ftps://` since PHP 4.3

- `ftp://example.com/pub/file.txt`

- `ftp://user:password@example.com/pub/file.txt`

- `ftps://example.com/pub/file.txt`

- `ftps://user:password@example.com/pub/file.txt`

Allows read access to existing files and creation of new files via FTP. If the server does not support passive mode ftp, the connection will fail.

You can open files for either reading or writing, but not both simultaneously. If the remote file already exists on the ftp server and you attempt to open it for writing, the connection will fail. If you need to update existing files over ftp, use ftp_connect().

`ftps://` was introduced in PHP 4.3. It is the same as `ftp://`, but attempts to negotiate a secure connection with the ftp server. If the server does not support SSL, then the connection falls back to regular unencrypted ftp.

> Note: FTPS is supported starting from PHP 4.3, if you have compiled in support for OpenSSL.

Prev | Home | Next
List of Supported Protocols/Wrappers | Up | PHP input/output streams