You are here

public function FormUploadedFile::isValid in Drupal 10

Returns whether the file was uploaded successfully.

Return value

bool TRUE if the file has been uploaded with HTTP and no error occurred.

Overrides UploadedFileInterface::isValid

File

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

Class

FormUploadedFile
Provides a bridge to Symfony UploadedFile.

Namespace

Drupal\file\Upload

Code

public function isValid() : bool {
  return $this->uploadedFile
    ->isValid();
}