MetaFox

UploadFile
in

Table of Contents

Methods

asUploadedFile()  : UploadedFile
Convert local file path to uploaded file.
convertBase64ToUploadedFile()  : UploadedFile
convertFile()  : UploadedFile|null
convertImageToBase64()  : string
getBase64()  : string|null
getFile()  : StorageFile
getFileId()  : int|null
getResizeImage()  : ResizeImageInterface
getStorage()  : string
Get storage server id.
isImage()  : bool
pathToUploadedFile()  : UploadedFile
rollUp()  : bool
setBase64()  : $this
setItemType()  : UploadFile
setPath()  : static
setStorage()  : self
Set storage by server_id.
setThumbSizes()  : self
Thumb sizes configure at "./config/image.php".
setUser()  : $this
storeAttachment()  : Attachment
storeAttachments()  : array<string|int, Attachment>
storeFile()  : StorageFile
storeFiles()  : array<string|int, StorageFile>
uploadWithParams()  : StorageFile

Methods

asUploadedFile()

Convert local file path to uploaded file.

public asUploadedFile(string $realpath[, string|null $originalName = null ][, bool $testMode = false ]) : UploadedFile
Parameters
$realpath : string
$originalName : string|null = null
$testMode : bool = false
Return values
UploadedFile

convertBase64ToUploadedFile()

public convertBase64ToUploadedFile(string $imageBase64) : UploadedFile
Parameters
$imageBase64 : string
Return values
UploadedFile

convertFile()

public convertFile(UploadedFile $file) : UploadedFile|null
Parameters
$file : UploadedFile
Return values
UploadedFile|null

convertImageToBase64()

public convertImageToBase64(string $realpath) : string
Parameters
$realpath : string
Return values
string

getBase64()

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

getFileId()

public getFileId(int|null $tempFileId[, bool $rollUp = false ]) : int|null
Parameters
$tempFileId : int|null
$rollUp : bool = false
Return values
int|null

getStorage()

Get storage server id.

public getStorage() : string
Return values
string

isImage()

public isImage(UploadedFile $file) : bool
Parameters
$file : UploadedFile
Return values
bool

pathToUploadedFile()

public static pathToUploadedFile(string $realpath[, string|null $newFileName = null ][, bool $isTestMode = true ]) : UploadedFile
Parameters
$realpath : string
$newFileName : string|null = null
$isTestMode : bool = true
Tags
SuppressWarnings

(PHPMD.BooleanArgumentFlag)

Return values
UploadedFile

rollUp()

public rollUp(int $id) : bool
Parameters
$id : int
Tags
throws
ModelNotFoundException
Return values
bool

setBase64()

public setBase64(string|null $base64) : $this
Parameters
$base64 : string|null
Return values
$this

setPath()

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

setStorage()

Set storage by server_id.

public setStorage(mixed $storageId) : self
Parameters
$storageId : mixed
Return values
self

setThumbSizes()

Thumb sizes configure at "./config/image.php".

public setThumbSizes(array<string|int, string> $sizes) : self
Parameters
$sizes : array<string|int, string>
Return values
self

setUser()

public setUser(User|null $user) : $this
Parameters
$user : User|null
Return values
$this

storeAttachments()

public storeAttachments(array<string|int, UploadedFile$files) : array<string|int, Attachment>
Parameters
$files : array<string|int, UploadedFile>
Return values
array<string|int, Attachment>

storeFiles()

public storeFiles(array<string|int, UploadedFile$files) : array<string|int, StorageFile>
Parameters
$files : array<string|int, UploadedFile>
Return values
array<string|int, StorageFile>

uploadWithParams()

public uploadWithParams(UploadedFile $file[, array<string, mixed> $params = [] ]) : StorageFile
Parameters
$file : UploadedFile
$params : array<string, mixed> = []
Return values
StorageFile

        
On this page

Search results