src/apis/StorageController.php
public function actionImageFilter()
    {
        $this->checkRouteAccess(self::PERMISSION_ROUTE);
        $image = Yii::$app->storage->createImage(Yii::$app->request->post('fileId', null), Yii::$app->request->post('filterId', null));
        if ($image) {
            return [
                'error' => false,
                'id' => $image->id,
                'image' => $image
            ];
        }

        return $this->sendArrayError([
            'error' => true,
            'message' => Module::t('api_storage_image_upload_error', ['error' => 'Unable to create the filter for the given image. Maybe the file source is not readable.']),
        ]);
    }
public function actionImageFilter()
    {
        $this->checkRouteAccess(self::PERMISSION_ROUTE);
        $image = Yii::$app->storage->createImage(Yii::$app->request->post('fileId', null), Yii::$app->request->post('filterId', null));
        if ($image) {
            return [
                'error' => false,
                'id' => $image->id,
                'image' => $image
            ];
        }

        return $this->sendArrayError([
            'error' => true,
            'message' => Module::t('api_storage_image_upload_error', ['error' => 'Unable to create the filter for the given image. Maybe the file source is not readable.']),
        ]);
    }
public function actionImageFilter ( ) { $ this -> checkRouteAccess ( self :: PERMISSION_ROUTE ) ; $ image = Yii :: $ app -> storage -> createImage ( Yii :: $ app -> request -> post ( 'fileId' , null ) , Yii :: $ app -> request -> post ( 'filterId' , null ) ) ; if ( $ image ) { return [ 'error' => false , 'id' => $ image -> id , 'image' => $ image ] ; } return $ this -> sendArrayError ( [ 'error' => true , 'message' => Module :: t ( 'api_storage_image_upload_error' , [ 'error' => 'Unable to create the filter for the given image. Maybe the file source is not readable.' ] ) , ] ) ; }
Upload an image to the filemanager.

@return array An array with
- error: Whether an error occured or not.
- id: The id of the image
- image: The image object (since 2.0)
Upload an image to the filemanager .