����JFIF��x�x����'
Server IP : 78.140.185.180 / Your IP : 216.73.216.82 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/builderbox/www/vendor/symfony/psr-http-message-bridge/Factory/ |
Upload File : |
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bridge\PsrHttpMessage\Factory; use Psr\Http\Message\UploadedFileInterface; use Symfony\Component\HttpFoundation\File\Exception\FileException; use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\HttpFoundation\File\UploadedFile as BaseUploadedFile; /** * @author Nicolas Grekas <p@tchwork.com> */ class UploadedFile extends BaseUploadedFile { private $psrUploadedFile; private $test = false; public function __construct(UploadedFileInterface $psrUploadedFile, callable $getTemporaryPath) { $error = $psrUploadedFile->getError(); $path = ''; if (\UPLOAD_ERR_NO_FILE !== $error) { $path = $psrUploadedFile->getStream()->getMetadata('uri') ?? ''; if ($this->test = !\is_string($path) || !is_uploaded_file($path)) { $path = $getTemporaryPath(); $psrUploadedFile->moveTo($path); } } parent::__construct( $path, (string) $psrUploadedFile->getClientFilename(), $psrUploadedFile->getClientMediaType(), $psrUploadedFile->getError(), $this->test ); $this->psrUploadedFile = $psrUploadedFile; } /** * {@inheritdoc} */ public function move($directory, $name = null): File { if (!$this->isValid() || $this->test) { return parent::move($directory, $name); } $target = $this->getTargetFile($directory, $name); try { $this->psrUploadedFile->moveTo($target); } catch (\RuntimeException $e) { throw new FileException(sprintf('Could not move the file "%s" to "%s" (%s)', $this->getPathname(), $target, $e->getMessage()), 0, $e); } @chmod($target, 0666 & ~umask()); return $target; } }