From c0c0a1b314d8d4666854188ad090478ac107e6c7 Mon Sep 17 00:00:00 2001 From: Sasha Rybkin Date: Fri, 19 Dec 2025 15:44:58 +0300 Subject: [PATCH] =?UTF-8?q?=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BC=D1=83=D1=81=D0=BE=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- File.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/File.php b/File.php index 4fc12d9..8ee2125 100644 --- a/File.php +++ b/File.php @@ -627,9 +627,11 @@ class File extends \yii\db\ActiveRecord $configs = Config::find()->andWhere(['module' => $this->module])->all(); foreach ($configs as $config) { - if(file_exists($this->getFilePath($config->type, true))) + $oldFile = $this->getFilePath($config->type, true); + if(file_exists($oldFile)) { - $s3->upload($this->getFilePath($config->type), $this->getFilePath($config->type, true)); + $s3->upload($this->getFilePath($config->type), $oldFile); + @unlink($oldFile); } } }