abstract |
---|
Base SystemFineUploadHandler class to work with ajaxfineupload.php endpoint
Upload files as specified
Do not use or reference this directly from your client-side code. Instead, this should be required via the endpoint.php or endpoint-cors.php file(s).
Methods | ||||||
---|---|---|---|---|---|---|
public
|
__construct(stdClass $claims)
XoopsFineUploadHandler constructor.
XoopsFineUploadHandler constructor. Parameters
Overriden by |
# | ||||
public
|
getName()
Get the original filename
Get the original filename |
# | ||||
public
|
getUploadName(): string
Get the name of the uploaded file
Get the name of the uploaded file |
# | ||||
public
|
combineChunks(string $uploadDirectory, string|null $name = null): array
Combine chunks into a single file
Combine chunks into a single file Parameters
Returnsresponse to be json encoded and returned to client |
# | ||||
public
|
handleUpload(string $uploadDirectory, string $name = null): array
Process the upload.
Process the upload. Parameters
Returnsresponse to be json encoded and returned to client |
# | ||||
protected
|
storeUploadedFile($target, $mimeType, $uuid)
|
# | ||||
public
|
handleDelete(string $uploadDirectory, string|null $name = null): array
Process a delete.
Process a delete. Parameters
Returnsresponse to be json encoded and returned to client |
# | ||||
protected
|
getUniqueTargetPath(string $uploadDirectory, string $filename): string|false
Returns a path to use with this upload. Check that the name does not exist,
and appends a suffix otherwise.
Returns a path to use with this upload. Check that the name does not exist, and appends a suffix otherwise. Parameters
Returnspath or false if path could not be determined |
# | ||||
protected
|
cleanupChunks(): void
Deletes all file parts in the chunks folder for files uploaded
more than chunksExpireIn seconds ago
Deletes all file parts in the chunks folder for files uploaded more than chunksExpireIn seconds ago |
# | ||||
protected
|
removeDir(string $dir): void
Removes a directory and all files contained inside
Removes a directory and all files contained inside |
# | ||||
protected
|
toBytes(string $str): int
Converts a given size with units to bytes.
Converts a given size with units to bytes. |
# | ||||
protected
|
isInaccessible(string $directory): bool
Determines whether a directory can be accessed.
Determines whether a directory can be accessed. is_executable() is not reliable on Windows prior PHP 5.0.0 (https://www.php.net/manual/en/function.is-executable.php) The following tests if the current OS is Windows and if so, merely checks if the folder is writable; otherwise, it checks additionally for executable status (like before). Parameters
Returnstrue if directory is NOT accessible |
# | ||||
protected
|
isWindows(): boolean
Determines is the OS is Windows or not
Determines is the OS is Windows or not |
# |
Properties | |||
---|---|---|---|
public
|
|
$allowedExtensions = []
|
# |
public
|
|
$allowedMimeTypes = ['(none)']
|
# |
public
|
|
$sizeLimit = null
|
# |
public
|
|
$inputName = 'qqfile'
|
# |
public
|
|
$chunksFolder = 'chunks'
|
# |
public
|
|
$chunksCleanupProbability = 0.001
|
# |
public
|
|
$chunksExpireIn = 604800
|
# |
protected
|
|
$uploadName
|
# |
public
|
|
$claims
|
# |