function UploadedFileInterface::isValid

Same name in other branches
  1. 9 core/modules/file/src/Upload/UploadedFileInterface.php \Drupal\file\Upload\UploadedFileInterface::isValid()

Returns whether the file was uploaded successfully.

Return value

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

Deprecated

in drupal:10.3.0 and is removed from drupal:11.0.0. Use \Drupal\file\Validation\UploadedFileValidatorInterface::validate() instead.

See also

https://www.drupal.org/node/3375456

2 methods override UploadedFileInterface::isValid()
FormUploadedFile::isValid in core/modules/file/src/Upload/FormUploadedFile.php
Returns whether the file was uploaded successfully.
InputStreamUploadedFile::isValid in core/modules/file/src/Upload/InputStreamUploadedFile.php
Returns whether the file was uploaded successfully.

File

core/modules/file/src/Upload/UploadedFileInterface.php, line 35

Class

UploadedFileInterface
Provides an interface for uploaded files.

Namespace

Drupal\file\Upload

Code

public function isValid() : bool;

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.