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

@param string $machine
@param string $buildToken
@param integer $fileId
@throws ForbiddenHttpException
@throws NotFoundHttpException
Return file storage data .