Class humhub\modules\file\actions\DownloadAction

Inheritancehumhub\modules\file\actions\DownloadAction » yii\base\Action
Available since version1.2

DownloadAction

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$enableHttpCache boolean Enable Http Caching humhub\modules\file\actions\DownloadAction

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
checkFileExists() Check if requested file exists humhub\modules\file\actions\DownloadAction
getFileName() Returns the filename humhub\modules\file\actions\DownloadAction
getModule() Returns the file module humhub\modules\file\actions\DownloadAction
getStoredFilePath() Returns the file path of the stored file humhub\modules\file\actions\DownloadAction
loadFile() Loads the file by given guid humhub\modules\file\actions\DownloadAction
loadVariant() Loads a variant and verifies humhub\modules\file\actions\DownloadAction
useXSendFile() Checks if XSendFile downloads are enabled humhub\modules\file\actions\DownloadAction

Property Details

$download protected property

Force download response

protected boolean $download false
$enableHttpCache public property

Enable Http Caching

See also \yii\filters\HttpCache.

public boolean $enableHttpCache true
$file protected property

The requested file object

$variant protected property

The requested file variant

protected string $variant null

Method Details

beforeRun() public method

public void beforeRun ( )
throws \yii\web\HttpException
checkFileExists() protected method

Check if requested file exists

protected void checkFileExists ( )
throws \yii\web\HttpException
getFileName() protected method

Returns the filename

protected string getFileName ( )
getModule() protected method

Returns the file module

protected humhub\modules\file\Module getModule ( )
getStoredFilePath() protected method

Returns the file path of the stored file

protected string getStoredFilePath ( )
return string

Path to the saved file

init() public method

public void init ( )
loadFile() protected method

Loads the file by given guid

protected humhub\modules\file\models\File loadFile ( $guid )
$guid string
return humhub\modules\file\models\File

The loaded file instance

throws \yii\web\HttpException
loadVariant() protected method

Loads a variant and verifies

protected void loadVariant ( $variant )
$variant string
throws \yii\web\HttpException
run() public method

public void run ( )
useXSendFile() protected method

Checks if XSendFile downloads are enabled

protected boolean useXSendFile ( )