User Tools

Site Tools


uphp:functions:ftp_size

This is an old revision of the document!


ftp_size

WM-MINI2, WM-MEGA FW >= 2.1137 WM-M2 FW >= 3.1137

Get the file size of a file on the remote FTP server

Description

int ftp_size ( string $filename )

Return the file size of a file on the remote server.

Parameters

$filename: String file name with our without path of the remote file

Return Values

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.

Example

<?
	$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();
	}
?>

See Also

ftp_open() - Open an FTP connection

ftp_close() - Close an FTP connection

uphp/functions/ftp_size.1561719780.txt.gz · Last modified: 2021/09/13 05:56 (external edit)