function UploadedFile::move
Same name in this branch
- 11.1.x vendor/symfony/http-foundation/File/UploadedFile.php \Symfony\Component\HttpFoundation\File\UploadedFile::move()
Overrides UploadedFile::move
File
-
vendor/
symfony/ psr-http-message-bridge/ Factory/ UploadedFile.php, line 51
Class
- UploadedFile
- @author Nicolas Grekas <p@tchwork.com>
Namespace
Symfony\Bridge\PsrHttpMessage\FactoryCode
public function move(string $directory, ?string $name = null) : File {
if (!$this->isValid() || $this->test) {
return parent::move($directory, $name);
}
$target = $this->getTargetFile($directory, $name);
try {
$this->psrUploadedFile
->moveTo((string) $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;
}