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

Breadcrumb

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

function HttpBrowser::getUploadedFiles

Recursively go through the list. If the file has a tmp_name, convert it to a DataPart. Keep the original hierarchy.

1 call to HttpBrowser::getUploadedFiles()
HttpBrowser::getBodyAndExtraHeaders in vendor/symfony/browser-kit/HttpBrowser.php

File

vendor/symfony/browser-kit/HttpBrowser.php, line 139

Class

HttpBrowser
An implementation of a browser using the HttpClient component to make real HTTP requests.

Namespace

Symfony\Component\BrowserKit

Code

private function getUploadedFiles(array $files) : array {
    $uploadedFiles = [];
    foreach ($files as $name => $file) {
        if (!\is_array($file)) {
            return $uploadedFiles;
        }
        if (!isset($file['tmp_name'])) {
            $uploadedFiles[$name] = $this->getUploadedFiles($file);
        }
        if (isset($file['tmp_name'])) {
            $uploadedFiles[$name] = DataPart::fromPath($file['tmp_name'], $file['name']);
        }
    }
    return $uploadedFiles;
}

API Navigation

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