You are here

private function HttpFoundationFactory::createUploadedFile in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/psr-http-message-bridge/Factory/HttpFoundationFactory.php \Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory::createUploadedFile()

Creates Symfony UploadedFile instance from PSR-7 ones.

Parameters

UploadedFileInterface $psrUploadedFile:

Return value

UploadedFile

1 call to HttpFoundationFactory::createUploadedFile()
HttpFoundationFactory::getFiles in vendor/symfony/psr-http-message-bridge/Factory/HttpFoundationFactory.php
Converts to the input array to $_FILES structure.

File

vendor/symfony/psr-http-message-bridge/Factory/HttpFoundationFactory.php, line 81

Class

HttpFoundationFactory
@author Kévin Dunglas <dunglas@gmail.com>

Namespace

Symfony\Bridge\PsrHttpMessage\Factory

Code

private function createUploadedFile(UploadedFileInterface $psrUploadedFile) {
  $temporaryPath = $this
    ->getTemporaryPath();
  $psrUploadedFile
    ->moveTo($temporaryPath);
  $clientFileName = $psrUploadedFile
    ->getClientFilename();
  return new UploadedFile($temporaryPath, null === $clientFileName ? '' : $clientFileName, $psrUploadedFile
    ->getClientMediaType(), $psrUploadedFile
    ->getSize(), $psrUploadedFile
    ->getError(), true);
}