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 on error.
ftp_size(ftp_connection,file)
parameter | describe |
---|---|
ftp_connection | Required. Specifies the FTP connection to use. |
file | Required. Specifies the documents to be checked. |
Note: Not all FTP servers support this function.
<?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