PHP ftp_size() Function

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

int ftp_size ( resource $ftp_stream , string $remote_file )

ftp_size() returns the size of the given file in bytes.

Example -

ParameterDescription
ftp_streamThe link identifier of the FTP connection
remote_fileThe remote file

Returns the file size on success, or -1 on error.