You are here

public function FormUploadedFile::getSize in Drupal 10

Gets file size.

Return value

int The filesize in bytes.

Overrides UploadedFileInterface::getSize

See also

https://www.php.net/manual/en/splfileinfo.getsize.php

File

core/modules/file/src/Upload/FormUploadedFile.php, line 60

Class

FormUploadedFile
Provides a bridge to Symfony UploadedFile.

Namespace

Drupal\file\Upload

Code

public function getSize() : int {
  return $this->uploadedFile
    ->getSize();
}