CoolCMS API

FtpFile
in package

Value object of a file in the uploads directory. `path` is always relative to the root (`uploads/`); the real server path never leaves the application. Downloads go only through the proxy endpoint by `path`, never by a direct link to the disk.

Table of Contents

Properties

$contentType  : string|null
$extension  : string
$name  : string
$path  : string
$size  : int

Methods

__construct()  : mixed
getContentType()  : string|null
getExtension()  : string
getName()  : string
getPath()  : string
Path of the file relative to the uploads root (e.g. `photos/cat.jpg`).
getSize()  : int
setContentType()  : $this
setExtension()  : $this
setName()  : $this
setPath()  : $this
setSize()  : $this

Properties

$contentType

private string|null $contentType = null

$extension

private string $extension = ''

Methods

__construct()

public __construct([string $name = '' ][, string $path = '' ][, string $extension = '' ][, int $size = 0 ][, string|null $contentType = null ]) : mixed
Parameters
$name : string = ''
$path : string = ''
$extension : string = ''
$size : int = 0
$contentType : string|null = null

getContentType()

public getContentType() : string|null
Return values
string|null

getExtension()

public getExtension() : string
Return values
string

getName()

public getName() : string
Return values
string

getPath()

Path of the file relative to the uploads root (e.g. `photos/cat.jpg`).

public getPath() : string
Return values
string

getSize()

public getSize() : int
Return values
int

setContentType()

public setContentType(string|null $contentType) : $this
Parameters
$contentType : string|null
Return values
$this

setExtension()

public setExtension(string $extension) : $this
Parameters
$extension : string
Return values
$this

setName()

public setName(string $name) : $this
Parameters
$name : string
Return values
$this

setPath()

public setPath(string $path) : $this
Parameters
$path : string
Return values
$this

setSize()

public setSize(int $size) : $this
Parameters
$size : int
Return values
$this
On this page

Search results