Class humhub\modules\file\actions\UploadAction

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

UploadAction provides an Ajax/JSON way to upload new files

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$fileClass string The file model (you may want to overwrite this for own validations) humhub\modules\file\actions\UploadAction
$scenario string Scenario for file upload validation humhub\modules\file\actions\UploadAction

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
getErrorResponse() Returns the error response for a file upload as array humhub\modules\file\actions\UploadAction
handleFileUpload() Handles the file upload for are particular UploadedFile humhub\modules\file\actions\UploadAction
isHideInStreamRequest() humhub\modules\file\actions\UploadAction
loadRecord() Loads the target record by request parameter if defined. humhub\modules\file\actions\UploadAction

Property Details

$fileClass protected property

The file model (you may want to overwrite this for own validations)

protected string $fileClass 'humhub\modules\file\models\FileUpload'
$record public property

The records

$scenario protected property

Scenario for file upload validation

protected string $scenario null
$uploadName public property
public string $uploadName 'files'

Method Details

getErrorResponse() protected method

Returns the error response for a file upload as array

protected array getErrorResponse ( humhub\modules\file\models\File $file )
$file humhub\modules\file\models\File
return array

The upload error information

handleFileUpload() protected method

Handles the file upload for are particular UploadedFile

protected void handleFileUpload ( \yii\web\UploadedFile $uploadedFile, $hideInStream false )
$uploadedFile
$hideInStream
init() public method

public void init ( )
isHideInStreamRequest() protected method

protected void isHideInStreamRequest ( )
loadRecord() protected method

Loads the target record by request parameter if defined.

The default implementation only supports uploads to ContentActiveRecord or ContentAddonActiveRecords.

protected void loadRecord ( )
run() public method

public void run ( )