Перестала работать загрузка картинок yii2

контроллер , после обновлений yii2 перестало работать, не могу понять в чем проблема, ругается на $addImgFile->extension, если заменить на png к примеру то потом ошибка if ($addImgFile->saveAs($dir . $modelProductImage->filename)) {

 public function actionMultipleImg()
{
    $this->enableCsrfValidation = false;
    if (Yii::$app->request->isPost) {
        $post = Yii::$app->request->post();

        $dir = Yii::getAlias('@productImgPath') . '/additional-image/';
       //https://stackoverflow.com/questions/34915739/yii2-sendfile-trying-to-get-property-of-non-object
        $result_link = str_replace('administrator', '', Url::home(true)) . 'storage/additional-image/';
        $addImgFile = UploadedFile::getInstanceByName('ProductImage[attachment]');
        $modelProductImage = new ProductImage();
        $modelProductImage->filename = strtotime('now') . '_' . Yii::$app->getSecurity()->generateRandomString(6) . '.' . $addImgFile->extension;
        $modelProductImage->load($post);
        $modelProductImage->validate();
       
        if ($modelProductImage->hasErrors()) {
            $result = ['error' => $modelProductImage->getFirstError('addImgFile')];
        } else {
            if ($addImgFile->saveAs($dir . $modelProductImage->filename)) {
                $imag = Yii::$app->image->load($dir . $modelProductImage->filename);
                $imag->save($dir . $modelProductImage->filename, 90);
                $result = ['filelink' => $result_link . $modelProductImage->filename, 'filename' => $modelProductImage->filename];
            } else {
                $result = ['error' => 'Ошибка'];
            }//else
        }//else
        $modelProductImage->save();
        Yii::$app->response->format = Response::FORMAT_JSON;

        return $result;
    } else {
        throw new BadRequestHttpException('Only POST is allowed');
    }
}//action multiple img

форма загрузки

<?php echo FileInput::widget([
            'attribute' => 'ProductImage[attachment]',
            'name' => 'ProductImage[attachment]',
            'options' => ['enctype' => 'multipart/form-data', 'accept' => 'image/*', 'multiple' => true],
            'pluginOptions' => [
                'deleteUrl' => Url::toRoute(['/product/delete-image']),
                'initialPreview' => $model->imagesLinks,
                'initialPreviewAsData' => true,
                'overwriteInitial' => false,
                'initialPreviewConfig' => $model->imagesLinksData,
                'uploadUrl' => Url::to(['/product/multiple-img']),
                'allowedFileExtensions' => ['jpg', 'png', 'jpeg', 'tiff', 'JPEG'],
                'previewFileType' => ['jpg', 'png', 'jpeg', 'tiff', 'JPEG'],
                'uploadExtraData' => [
                    'ProductImage[product_id]' => $model->id,
                ],
                'maxFileCount' => 10
            ],
            'pluginEvents' => [
                'filesorted' => new JsExpression('function(event, params){
        $.post("' . Url::toRoute(["/product/sort-image", "id" => $model->id]) . '", {position:params});
    }')
            ],
        ]); ?>

Ответы (0 шт):