Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. UploadedFile.php

function UploadedFile::isValid

Returns whether the file has been uploaded with HTTP and no error occurred.

2 calls to UploadedFile::isValid()
UploadedFile::move in vendor/symfony/psr-http-message-bridge/Factory/UploadedFile.php
Moves the file to a new location.
UploadedFile::move in vendor/symfony/http-foundation/File/UploadedFile.php
Moves the file to a new location.

File

vendor/symfony/http-foundation/File/UploadedFile.php, line 169

Class

UploadedFile
A file uploaded through a form.

Namespace

Symfony\Component\HttpFoundation\File

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal