ftp_size
Returns the size of the specified file.
ftp_size()
function returns the size of the specified file.
<?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); ?>
输出类似:
160
ftp_size ( ftp_connection , remote_file )
parameter | describe |
---|---|
ftp_connection | Required. Specifies the FTP connection to be used (the identifier of the FTP connection). |
remote_file | Required. Specify documents to be inspected. |
The ftp_size() function returns the size of the remote file remote_file in bytes. If the specified file does not exist or an error occurs, returns -1. Some FTP servers may not support this feature.
If the acquisition is successful, the file size is returned, otherwise -1 is returned.