PHP ftp_size() Function

PHP FTP Reference : Get size of a file on the FTP server

Definition and Usage

The ftp_size() function returns the size of a specified file on the FTP server.

Note: Not all FTP servers support this function!

Syntax

ftp_size(ftp_conn, file);

Parameter Values

Parameter Description
ftp_conn Required. Specifies the FTP connection to use
file Required. Specifies the server file to check

Technical Details

Return Value: The size of the file (in bytes) on success, or -1 on error
PHP Version: 4+

❮ PHP FTP Reference