Current Location: Home> Function Categories> ftp_size

ftp_size

Returns the size of the specified file.
Name:ftp_size
Category:Uncategorized
Programming Language:php
One-line Description:Returns the size of the specified file.

Definition and usage

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

grammar

 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.

illustrate

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.

Similar Functions
Popular Articles