public function UploadedFile::isValid

Returns whether the file was uploaded successfully.

@api

Return value

Boolean True if the file has been uploaded with HTTP and no error occurred.

1 call to UploadedFile::isValid()
UploadedFile::move in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php
Moves the file to a new location.

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php, line 217

Class

UploadedFile
A file uploaded through a form.

Namespace

Symfony\Component\HttpFoundation\File

Code

public function isValid() {
  $isOk = $this->error === UPLOAD_ERR_OK;
  return $this->test ? $isOk : $isOk && is_uploaded_file($this
    ->getPathname());
}