system/Files/File.php
public function getSize(string $unit = 'b')
	{
		if (is_null($this->size))
		{
			$this->size = filesize($this->getPathname());
		}

		switch (strtolower($unit))
		{
			case 'kb':
				return number_format($this->size / 1024, 3);
			case 'mb':
				return number_format(($this->size / 1024) / 1024, 3);
		}

		return (int) $this->size;
	}
public function getSize(string $unit = 'b')
	{
		if (is_null($this->size))
		{
			$this->size = filesize($this->getPathname());
		}

		switch (strtolower($unit))
		{
			case 'kb':
				return number_format($this->size / 1024, 3);
			case 'mb':
				return number_format(($this->size / 1024) / 1024, 3);
		}

		return (int) $this->size;
	}
Retrieve the file size.

Implementations SHOULD return the value stored in the "size" key of
the file in the $_FILES array if available, as PHP calculates this based
on the actual size transmitted.

@param string $unit The unit to return:
- b   Bytes
- kb  Kilobytes
- mb  Megabytes

@return integer|null The file size in bytes or null if unknown.