Documentation

FileComponent extends Injectable
in package

Table of Contents

Properties

$destination  : string
Destination path.
$file  : string|File
File.
$filename  : string
Filename.
$mimeType  : string
MIME-type.
$target  : string
Target path.

Methods

download()  : mixed
Download a file.
getFilename()  : string
Get the fileName.
getMime()  : string
Get MIME-type.
getPath()  : mixed
getTarget()  : string
Get target.
isExists()  : mixed
parseMime()  : string
Parse file MIME-type.
remove()  : bool
Remove attachment.
setFile()  : FileComponent
Set the file.
setFilename()  : FileComponent
Set the fileName.
setMime()  : FileComponent
Set MIME-type.
setTarget()  : FileComponent
Set target path.
upload()  : bool|string
Upload attachment.
clearDirectory()  : mixed
Clear the given directory, if it is empty.
createDirectories()  : mixed
Create target and destination directories,<br> if they are not directories.

Properties

$destination

Destination path.

protected string $destination

$mimeType

MIME-type.

protected string $mimeType = 'text/plain'

Methods

download()

Download a file.

public download([string $alias = null ][, bool $deleteAfter = false ]) : mixed
Parameters
$alias : string = null

File alias name

$deleteAfter : bool = false

Delete after download

Tags
throws
Exception

getFilename()

Get the fileName.

public getFilename() : string
Return values
string

getMime()

Get MIME-type.

public getMime() : string
Return values
string

getTarget()

Get target.

public getTarget() : string
Return values
string

parseMime()

Parse file MIME-type.

public parseMime(string $filename) : string
Parameters
$filename : string
Return values
string

remove()

Remove attachment.

public remove() : bool
Tags
throws
Exception
Return values
bool

upload()

Upload attachment.

public upload() : bool|string
Tags
throws
Exception
Return values
bool|string

clearDirectory()

Clear the given directory, if it is empty.

private clearDirectory(string $directory) : mixed
Parameters
$directory : string

Path of directory

createDirectories()

Create target and destination directories,<br> if they are not directories.

private createDirectories() : mixed
Tags
throws
Exception

        
On this page

Search results