UploadFileManager implements IErrorable
Table of Contents
Interfaces
Constants
- DEFAULT_CHUNK_SIZE = 5242880
- ERROR_CHUNK_ERROR = 'DISK_UPL_M_22001'
- ERROR_CREATE_TMP_FILE_BUCKET = 'DISK_UPL_M_22002'
- ERROR_CREATE_TMP_FILE_LAST_HERO = 'DISK_UPL_M_22005'
- ERROR_CREATE_TMP_FILE_NON_BUCKET = 'DISK_UPL_M_22003'
- ERROR_EMPTY_TOKEN = 'DISK_UPL_M_22004'
- ERROR_UNKNOWN_TOKEN = 'DISK_UPL_M_22006'
Methods
- __construct() : mixed
- findUserSpecificTmpFileByToken() : TmpFile|null
- getChunkSize() : int
- Returns size for chunk-upload.
- getContentRange() : array<string|int, mixed>
- getErrorByCode() : array<string|int, Error>
- Getting once error with the necessary code.
- getErrors() : array<string|int, Error>
- Getting array of errors.
- getErrorsByCode() : array<string|int, Error>
- Getting array of errors with the necessary code.
- getFileSize() : int
- getToken() : string
- getUserId() : int
- removeIrrelevant() : string
- Remove irrelevant tmp files.
- rollbackByToken() : bool
- Rollback upload by token. Destroy temporary content.
- setContentRange() : $this
- setFileSize() : $this
- setTmpFileClass() : UploadFileManager
- setToken() : $this
- setUser() : $this
- setUserId() : $this
- upload() : mixed
Constants
DEFAULT_CHUNK_SIZE
public
mixed
DEFAULT_CHUNK_SIZE
= 5242880
ERROR_CHUNK_ERROR
public
mixed
ERROR_CHUNK_ERROR
= 'DISK_UPL_M_22001'
ERROR_CREATE_TMP_FILE_BUCKET
public
mixed
ERROR_CREATE_TMP_FILE_BUCKET
= 'DISK_UPL_M_22002'
ERROR_CREATE_TMP_FILE_LAST_HERO
public
mixed
ERROR_CREATE_TMP_FILE_LAST_HERO
= 'DISK_UPL_M_22005'
ERROR_CREATE_TMP_FILE_NON_BUCKET
public
mixed
ERROR_CREATE_TMP_FILE_NON_BUCKET
= 'DISK_UPL_M_22003'
ERROR_EMPTY_TOKEN
public
mixed
ERROR_EMPTY_TOKEN
= 'DISK_UPL_M_22004'
ERROR_UNKNOWN_TOKEN
public
mixed
ERROR_UNKNOWN_TOKEN
= 'DISK_UPL_M_22006'
Methods
__construct()
public
__construct() : mixed
findUserSpecificTmpFileByToken()
public
findUserSpecificTmpFileByToken() : TmpFile|null
Return values
TmpFile|nullgetChunkSize()
Returns size for chunk-upload.
public
getChunkSize(string $filename, int $fileSize) : int
Parameters
- $filename : string
-
Filename.
- $fileSize : int
-
Size of file in bytes
Return values
intgetContentRange()
public
getContentRange() : array<string|int, mixed>
Return values
array<string|int, mixed>getErrorByCode()
Getting once error with the necessary code.
public
getErrorByCode(mixed $code) : array<string|int, Error>
Parameters
- $code : mixed
-
Code of error.
Tags
Return values
array<string|int, Error>getErrors()
Getting array of errors.
public
getErrors() : array<string|int, Error>
Return values
array<string|int, Error>getErrorsByCode()
Getting array of errors with the necessary code.
public
getErrorsByCode(mixed $code) : array<string|int, Error>
Parameters
- $code : mixed
-
Code of error.
Tags
Return values
array<string|int, Error>getFileSize()
public
getFileSize() : int
Return values
intgetToken()
public
getToken() : string
Return values
stringgetUserId()
public
getUserId() : int
Return values
intremoveIrrelevant()
Remove irrelevant tmp files.
public
static removeIrrelevant() : string
Return values
stringrollbackByToken()
Rollback upload by token. Destroy temporary content.
public
rollbackByToken() : bool
Return values
bool —Status of delete.
setContentRange()
public
setContentRange(array<string|int, mixed> $contentRange) : $this
Parameters
- $contentRange : array<string|int, mixed>
Return values
$thissetFileSize()
public
setFileSize(int $fileSize) : $this
Parameters
- $fileSize : int
Return values
$thissetTmpFileClass()
public
setTmpFileClass(string $tmpFileClass) : UploadFileManager
Parameters
- $tmpFileClass : string
Return values
UploadFileManagersetToken()
public
setToken(string $token) : $this
Parameters
- $token : string
Return values
$thissetUser()
public
setUser(CUser|User|int $user) : $this
Parameters
- $user : CUser|User|int
Return values
$thissetUserId()
public
setUserId(int $userId) : $this
Parameters
- $userId : int
Return values
$thisupload()
public
upload(mixed $filename, array<string|int, mixed> $fileData) : mixed
Parameters
- $filename : mixed
- $fileData : array<string|int, mixed>