Example #1
0
 /**
  * Загрузка картинок с последующим созданием Thumbs
  *
  * @example {"user": {"id": "1"},"data":{"base64Image":"base64content", "thumbsCategoryId":1, "name":"image_name", "url":"if base64Image not passed", "title":"title", "description":"description"}}
  */
 public function actionUploadWithCategory()
 {
     /* @var $request \app\modules\services\components\GiraffeRequest */
     $request = \Yii::$app->request;
     $data = $request->getApiData();
     $form = new UploadForm();
     $form->setScenario('withCategory');
     $form->setAttributes($data);
     if (!$form->validate()) {
         return $this->renderJsonMessage($form->getErrors());
     }
     $fileInformationRow = $this->_uploadFromMemeberForm($form, $form->thumbsCategoryId);
     return $this->renderJsonMessage($fileInformationRow);
 }