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
UploadedFileconvertBase64ToUploadedFile()
public
convertBase64ToUploadedFile(string $imageBase64) : UploadedFile
Parameters
- $imageBase64 : string
Return values
UploadedFileconvertFile()
public
convertFile(UploadedFile $file) : UploadedFile|null
Parameters
- $file : UploadedFile
Return values
UploadedFile|nullconvertImageToBase64()
public
convertImageToBase64(string $realpath) : string
Parameters
- $realpath : string
Return values
stringgetBase64()
public
getBase64() : string|null
Return values
string|nullgetFile()
public
getFile(int $id) : StorageFile
Parameters
- $id : int
Tags
Return values
StorageFilegetFileId()
public
getFileId(int|null $tempFileId[, bool $rollUp = false ]) : int|null
Parameters
- $tempFileId : int|null
- $rollUp : bool = false
Return values
int|nullgetResizeImage()
public
getResizeImage() : ResizeImageInterface
Return values
ResizeImageInterfacegetStorage()
Get storage server id.
public
getStorage() : string
Return values
stringisImage()
public
isImage(UploadedFile $file) : bool
Parameters
- $file : UploadedFile
Return values
boolpathToUploadedFile()
public
static pathToUploadedFile(string $realpath[, string|null $newFileName = null ][, bool $isTestMode = true ]) : UploadedFile
Parameters
- $realpath : string
- $newFileName : string|null = null
- $isTestMode : bool = true
Tags
Return values
UploadedFilerollUp()
public
rollUp(int $id) : bool
Parameters
- $id : int
Tags
Return values
boolsetBase64()
public
setBase64(string|null $base64) : $this
Parameters
- $base64 : string|null
Return values
$thissetItemType()
public
setItemType(string|null $itemType) : UploadFile
Parameters
- $itemType : string|null
Return values
UploadFilesetPath()
public
setPath(string $path) : static
Parameters
- $path : string
Return values
staticsetStorage()
Set storage by server_id.
public
setStorage(mixed $storageId) : self
Parameters
- $storageId : mixed
Return values
selfsetThumbSizes()
Thumb sizes configure at "./config/image.php".
public
setThumbSizes(array<string|int, string> $sizes) : self
Parameters
- $sizes : array<string|int, string>
Return values
selfsetUser()
public
setUser(User|null $user) : $this
Parameters
- $user : User|null
Return values
$thisstoreAttachment()
public
storeAttachment(UploadedFile $file) : Attachment
Parameters
- $file : UploadedFile
Return values
AttachmentstoreAttachments()
public
storeAttachments(array<string|int, UploadedFile> $files) : array<string|int, Attachment>
Parameters
- $files : array<string|int, UploadedFile>
Return values
array<string|int, Attachment>storeFile()
public
storeFile(UploadedFile $uploadedFile) : StorageFile
Parameters
- $uploadedFile : UploadedFile
Return values
StorageFilestoreFiles()
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> = []