WM-MINI2, WM-MEGA FW >= 2.1137 WM-M2 FW >= 3.1137
Get the file size of a file on the remote FTP server
Return the file size of a file on the remote server.
$filename: String file name with our without path of the remote file
int: Size of the file in bytes if the value is above or equal to 0.
If the return value is -1, the function failed due to network or other issues.
If the return value is -2, the remote file does not exist.
<? $res = ftp_open("ftp.myserver.com",21,"myuser","mypassword"); if ($res) { // get the current directory on the server $res=ftp_size("myfile.txt"); print("File size is: ".$res."\r\n"); ftp_close(); } ?>
ftp_open() - Open an FTP connection
ftp_close() - Close an FTP connection
ftp_command() - Send an FTP command
ftp_error() - Get last FTP response code
ftp_is_connected() - Check if the FTP connection is active
ftp_is_connecting() - Check if the FTP connection is in the process of connecting
ftp_is_busy() - Check if the FTP engine is busy
ftp_list() - Lists a folder on the FTP server and outputs the result to the specified file
ftp_status() - Get active transfer and connections status
ftp_upload() - Upload a file
ftp_download() - Download a file