WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

PHP ftp_size () function


Definition and usage

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

This function returns the size of the specified file in bytes, or -1 if an error occurs.

Syntax

ftp_size (ftp_connection, file)

parameters description
ftp_connection Required. Specifies the FTP connection to use.
file Required. Specifies the documents to be checked.


Tips and comments

Note: Not all FTP servers support this function.


Example

<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");

echo ftp_size($conn,"test.txt");

ftp_close($conn);
?>

The above code will output:

160