Skip to content

File

Properties

index

public string|int $index

name

public string $name

filename

public ?string $filename

size

public ?int $size

type

public ?string $type

errors

public int $errors

tmpName

public ?string $tmpName

Methods

__construct

public __construct(string|int $index): mixed

Parameters:

Parameter Type Description
$index string|int

createFromArray

Create from array

public static createFromArray(array $values): static
  • This method is static.

Parameters:

Parameter Type Description
$values array

Throws:


getIndex

public getIndex(): string

setIndex

Set input index

public setIndex(string $index): static

Parameters:

Parameter Type Description
$index string

getSize

public getSize(): int

setSize

Set file size

public setSize(int $size): static

Parameters:

Parameter Type Description
$size int

getMime

Get mime-type of file

public getMime(): string

getType

public getType(): string

setType

Set type

public setType(string $type): static

Parameters:

Parameter Type Description
$type string

getExtension

Returns extension without "."

public getExtension(): string

getName

Get human friendly name

public getName(): ?string

setName

Set human friendly name.

public setName(string $name): static

Useful for adding validation etc.

Parameters:

Parameter Type Description
$name string

setFilename

Set filename

public setFilename(string $name): static

Parameters:

Parameter Type Description
$name string

getFilename

Get filename

public getFilename(): null|string

Return Value:

mixed


move

Move the uploaded temporary file to it's new home

public move(string $destination): bool

Parameters:

Parameter Type Description
$destination string

getContents

Get file contents

public getContents(): string

hasError

Return true if an upload error occurred.

public hasError(): bool

getError

Get upload-error code.

public getError(): ?int

setError

Set error

public setError(?int $error = null): static

Parameters:

Parameter Type Description
$error ?int

getTmpName

public getTmpName(): string

setTmpName

Set file temp. name

public setTmpName(string $name): static

Parameters:

Parameter Type Description
$name string

__toString

public __toString(): string

getValue

public getValue(): ?string

setValue

public setValue(string $value): static

Parameters:

Parameter Type Description
$value string

toArray

public toArray(): array


Automatically generated on 2025-10-13