mirror of
https://github.com/crazywhalecc/choir-psr-http.git
synced 2026-07-23 16:45:38 +08:00
Update UploadedFile.php
This commit is contained in:
@@ -23,6 +23,8 @@ class UploadedFile implements UploadedFileInterface
|
|||||||
*/
|
*/
|
||||||
private $file;
|
private $file;
|
||||||
|
|
||||||
|
private string $key;
|
||||||
|
|
||||||
private bool $moved = false;
|
private bool $moved = false;
|
||||||
|
|
||||||
private ?int $size;
|
private ?int $size;
|
||||||
@@ -45,12 +47,18 @@ class UploadedFile implements UploadedFileInterface
|
|||||||
$this->client_media_type = $this->fileinfo['type'] ?? null;
|
$this->client_media_type = $this->fileinfo['type'] ?? null;
|
||||||
$this->error = $this->fileinfo['error'];
|
$this->error = $this->fileinfo['error'];
|
||||||
$this->size = $this->fileinfo['size'];
|
$this->size = $this->fileinfo['size'];
|
||||||
|
$this->key = $this->fileinfo['key'];
|
||||||
|
|
||||||
if ($this->isOk()) {
|
if ($this->isOk()) {
|
||||||
$this->file = $this->fileinfo['tmp_name'];
|
$this->file = $this->fileinfo['tmp_name'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getKey(): string
|
||||||
|
{
|
||||||
|
return $this->key;
|
||||||
|
}
|
||||||
|
|
||||||
public function isMoved(): bool
|
public function isMoved(): bool
|
||||||
{
|
{
|
||||||
return $this->moved;
|
return $this->moved;
|
||||||
|
|||||||
Reference in New Issue
Block a user