PHP Class mdm\upload\FileModel

Inheritance: extends yii\db\ActiveRecord
Show file Open project: mdmsoft/yii2-upload-file Class Usage Examples

Public Properties

Property Type Description
$defaultDirectoryLevel integer
$defaultUploadPath string
$directoryLevel the level of sub-directories to store uploaded files. Defaults to 1. If the system has huge number of uploaded files (e.g. one million), you may use a bigger value (usually no bigger than 3). Using sub-directories is mainly to ensure the file system is not over burdened with a single directory having too many files.
$file yii\web\UploadedFile
$saveCallback Closure
$uploadPath Upload path

Public Methods

Method Description
attributeLabels ( )
beforeDelete ( )
beforeSave ( $insert )
getContent ( )
rules ( )
saveAs ( UploadedFile | string $file, array $options = [] ) : boolean | static Save file
tableName ( )

Method Details

attributeLabels() public method

public attributeLabels ( )

beforeDelete() public method

public beforeDelete ( )

beforeSave() public method

public beforeSave ( $insert )

getContent() public method

public getContent ( )

rules() public method

public rules ( )

saveAs() public static method

Save file
public static saveAs ( UploadedFile | string $file, array $options = [] ) : boolean | static
$file yii\web\UploadedFile | string
$options array
return boolean | static

tableName() public static method

public static tableName ( )

Property Details

$defaultDirectoryLevel public static property

public static int $defaultDirectoryLevel
return integer

$defaultUploadPath public static property

public static string $defaultUploadPath
return string

$directoryLevel public property

the level of sub-directories to store uploaded files. Defaults to 1. If the system has huge number of uploaded files (e.g. one million), you may use a bigger value (usually no bigger than 3). Using sub-directories is mainly to ensure the file system is not over burdened with a single directory having too many files.
public $directoryLevel

$file public property

public UploadedFile,yii\web $file
return yii\web\UploadedFile

$saveCallback public property

public Closure $saveCallback
return Closure

$uploadPath public property

Upload path
public $uploadPath