From 197f195ef75dd8db528a459154ba917c0fd644b9 Mon Sep 17 00:00:00 2001 From: katsuren Date: Mon, 4 Jul 2022 22:49:43 +0900 Subject: [PATCH] cleanup file regardless of the stream Signed-off-by: katsuren --- src/UploadedFile.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/UploadedFile.php b/src/UploadedFile.php index 93e94195..e918697f 100644 --- a/src/UploadedFile.php +++ b/src/UploadedFile.php @@ -190,9 +190,9 @@ public function moveTo($targetPath) : void if ($this->stream instanceof StreamInterface) { $this->stream->close(); - if (is_string($this->file) && file_exists($this->file)) { - unlink($this->file); - } + } + if (is_string($this->file) && file_exists($this->file)) { + unlink($this->file); } break; default: