src/apis/ProxyController.php
public function actionImageProvider($machine, $buildToken, $imageId)
    {
        $build = $this->ensureBuild($machine, $buildToken);
    
        if ($build) {
            if (!is_numeric($imageId)) {
                throw new ForbiddenHttpException("Invalid image id input.");
            }
    
            $image = Yii::$app->storage->getImage($imageId);
            /* @var $image \luya\admin\image\Item */
            if ($image->fileExists) {
                return Yii::$app->response->sendFile($image->serverSource)->send();
            }
            
            throw new NotFoundHttpException("The requested image '".$image->serverSource."' does not exist in the storage folder.");
        }
    }
public function actionImageProvider($machine, $buildToken, $imageId)
    {
        $build = $this->ensureBuild($machine, $buildToken);
    
        if ($build) {
            if (!is_numeric($imageId)) {
                throw new ForbiddenHttpException("Invalid image id input.");
            }
    
            $image = Yii::$app->storage->getImage($imageId);
            /* @var $image \luya\admin\image\Item */
            if ($image->fileExists) {
                return Yii::$app->response->sendFile($image->serverSource)->send();
            }
            
            throw new NotFoundHttpException("The requested image '".$image->serverSource."' does not exist in the storage folder.");
        }
    }
public function actionImageProvider ( $ machine , $ buildToken , $ imageId ) { $ build = $ this -> ensureBuild ( $ machine , $ buildToken ) ; if ( $ build ) { if ( ! is_numeric ( $ imageId ) ) { throw new ForbiddenHttpException ( "Invalid image id input." ) ; } $ image = Yii :: $ app -> storage -> getImage ( $ imageId ) ; /* @var $image \luya\admin\image\Item */ if ( $ image -> fileExists ) { return Yii :: $ app -> response -> sendFile ( $ image -> serverSource ) -> send ( ) ; } throw new NotFoundHttpException ( "The requested image '" . $ image -> serverSource . "' does not exist in the storage folder." ) ; } }
Return image storage data.

@param string $machine
@param string $buildToken
@param integer $imageId
@throws ForbiddenHttpException
@throws NotFoundHttpException
Return image storage data .