You are here

public function FormUploadedFile::getError in Drupal 10

Returns the upload error code.

If the upload was successful, the constant UPLOAD_ERR_OK is returned. Otherwise, one of the other UPLOAD_ERR_XXX constants is returned.

Return value

int The upload error code.

Overrides UploadedFileInterface::getError

File

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

Class

FormUploadedFile
Provides a bridge to Symfony UploadedFile.

Namespace

Drupal\file\Upload

Code

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