Methods |
public
|
getFilecacheManager()
|
#
|
public
static
|
Decorator(): Module
|
#
|
public
|
init()
Initializes Files Module.
Initializes Files Module.
Implements
|
#
|
public
|
onGetInheritedAttributes(&$aArgs, &$aResult)
|
#
|
public
|
getRawFileData($iUserId, $sType, $sPath, $sFileName, $SharedHash = null, $sAction = '', $iOffset = 0, $iChunkSize = 0)
|
#
|
public
|
getRawFile(
int $iUserId,
string $sType,
string $sPath,
string $sFileName,
string $SharedHash = null,
string $sAction = '',
$iOffset = 0,
$iChunkSize = 0,
$bShared = false,
): void
Downloads file, views file or makes thumbnail for file.
Downloads file, views file or makes thumbnail for file.
Parameters
$iUserId |
User identifier.
|
$sType |
Storage type - personal, corporate.
|
$sPath |
Path to folder contained file.
|
$sFileName |
File name.
|
$SharedHash |
Indicates if file should be downloaded or viewed.
|
$sAction |
Indicates if thumbnail should be created for file.
|
|
#
|
public
|
UploadFileData()
Uploads file from client side.
Uploads file from client side.
echo string "true" or "false"
Throws
|
#
|
public
|
GetSettings(): array
Obtains list of module settings for authenticated user.
Obtains list of module settings for authenticated user.
Overrides
|
#
|
public
|
GetSettingsForEntity($EntityType, $EntityId)
|
#
|
public
|
UpdateSettings(bool $EnableUploadSizeLimit, int $UploadSizeLimitMb): bool
Updates module's settings - saves them to config.json file.
Updates module's settings - saves them to config.json file.
Parameters
$EnableUploadSizeLimit |
Enable file upload size limit setting.
|
$UploadSizeLimitMb |
Upload file size limit setting in Mb.
|
|
#
|
public
|
UploadFile(
int $UserId,
string $Type,
string $Path,
array $UploadData,
string $SubPath = '',
bool $Overwrite = true,
int $RangeType = 0,
int $Offset = 0,
array $ExtendedProps = [],
): array
Uploads file from client side.
Uploads file from client side.
Parameters
$UserId |
User identifier.
|
$Type |
Type of storage - personal, corporate.
|
$Path |
Path to folder than should contain uploaded file.
|
$UploadData |
Uploaded file information. Contains fields size, name, tmp_name.
|
$SubPath |
Relative path to subfolder where file should be uploaded.
|
$Overwrite |
Overwrite a file if it already exists.
|
$RangeType |
The type of update we're doing.
- 0 - overwrite
- 1 - append
- 2 - update based on a start byte
- 3 - update based on an end byte
;
|
$Offset |
The start or end byte.
|
$ExtendedProps |
Additional parameters.
|
Returns
{
string Name Original file name.
string TempName Temporary file name.
string MimeType Mime type of file.
int Size File size.
string Hash Hash used for file download, file view or getting file thumbnail.
}
Throws
|
#
|
public
|
EntryDownloadFile()
|
#
|
public
|
ViewFile(int $UserId, string $Type, string $Path, string $Name, string $SharedHash): void
Views file.
Parameters
$UserId |
User identifier.
|
$Type |
Storage type - personal, corporate.
|
$Path |
Path to folder contained file.
|
$Name |
File name.
|
$SharedHash |
Shared hash.
|
|
#
|
public
|
GetFileThumbnail(int $UserId, string $Type, string $Path, string $Name, string $SharedHash): bool
Makes thumbnail for file.
Makes thumbnail for file.
Parameters
$UserId |
User identifier.
|
$Type |
Storage type - personal, corporate.
|
$Path |
Path to folder contained file.
|
$Name |
File name.
|
$SharedHash |
Shared hash.
|
|
#
|
public
|
GetStorages(): array
Returns storages available for logged in user.
Returns storages available for logged in user.
Returns
{
string Type Storage type - personal, corporate.
string DisplayName Storage display name.
bool IsExternal Indicates if storage external or not.
}
|
#
|
public
|
GetSubModules()
Returns submodules.
|
#
|
public
|
GetQuota(int $UserId, $Type): array
Returns used space and space limit for specified user.
Returns used space and space limit for specified user.
Parameters
Returns
{
int Used Amount of space used by user.
int Limit Limit of space for user.
}
|
#
|
public
|
CheckQuota($UserId, $Type, $Size)
|
#
|
public
|
GetItems($UserId, $Type, $Path, $Pattern, $PublicHash = null, $Shared = false)
|
#
|
public
|
GetFiles(int $UserId, string $Type, string $Path, string $Pattern, $Shared = false): array
Returns file list and user quota information.
Returns file list and user quota information.
Parameters
$UserId |
User identifier.
|
$Type |
Type of storage.
|
$Path |
Path to folder files are obtained from.
|
$Pattern |
String for search files and folders with such string in name.
|
Returns
{
array Items Array of files objects.
array Quota Array of items with fields Used, Limit.
}
Throws
|
#
|
public
|
onAfterGetStorages(array $aArgs, mixed &$mResult)
|
#
|
public
|
onAfterRename(array $aArgs, mixed &$mResult)
|
#
|
public
|
onAfterMove($aArgs, &$mResult)
|
#
|
public
|
onAfterCreateUser(array $aArgs, mixed &$mResult)
|
#
|
public
|
PopulateFileItem($UserId, $Item)
|
#
|
public
|
PopulateFileItems($UserId, $Items)
|
#
|
public
|
GetFileContent(int $UserId, string $Type, string $Path, string $Name)
Return content of a file.
Return content of a file.
|
#
|
public
|
GetFileInfo(int $UserId, string $Type, string $Path, string $Id): FileInfo
Return information about file. Subscribers of "Files::GetFileInfo::after" event are used for collecting information.
Return information about file. Subscribers of "Files::GetFileInfo::after" event are used for collecting information.
|
#
|
public
|
GetPublicFiles(string $Hash, string $Path): array
Returns list of public files.
Returns list of public files.
Parameters
$Hash |
Hash to identify the list of files to return. Containes information about user identifier, type of storage, path to public folder, name of public folder.
|
$Path |
Path to folder contained files to return.
|
Returns
{
array Items Array of files objects.
array Quota Array of items with fields Used, Limit.
}
Throws
|
#
|
public
|
CreateFolder(int $UserId, string $Type, string $Path, string $FolderName): bool
Creates folder.
Parameters
$UserId |
User identifier.
|
$Type |
Type of storage - personal, corporate.
|
$Path |
Path to new folder.
|
$FolderName |
New folder name.
|
Throws
|
#
|
public
|
CreateLink(int $UserId, string $Type, string $Path, string $Link, string $Name): bool
Creates link.
Parameters
$UserId |
User identifier.
|
$Type |
Type of storage - personal, corporate.
|
$Path |
Path to new link.
|
$Link |
Link value.
|
$Name |
Link name.
|
Throws
|
#
|
public
|
Delete(int $UserId, string $Type, array $Items): bool
Deletes files and folder specified with list.
Deletes files and folder specified with list.
Parameters
$UserId |
User identifier.
|
$Type |
Type of storage - personal, corporate.
|
$Items |
Array of items to delete.
|
Throws
|
#
|
public
|
LeaveShare(int $UserId, string $Type, array $Items): bool
Leave shared files and folder specified with list.
Leave shared files and folder specified with list.
Parameters
$UserId |
User identifier.
|
$Type |
Type of storage - personal, corporate.
|
$Items |
Array of items to leave.
|
Throws
|
#
|
public
|
Rename(int $UserId, string $Type, string $Path, string $Name, string $NewName, bool $IsLink): bool
Renames folder, file or link.
Renames folder, file or link.
Parameters
$UserId |
User identifier.
|
$Type |
Type of storage - personal, corporate.
|
$Path |
Path to item to rename.
|
$Name |
Current name of the item.
|
$NewName |
New name of the item.
|
$IsLink |
Indicates if the item is link or not.
|
Throws
|
#
|
public
|
Copy(int $UserId, string $FromType, string $ToType, string $FromPath, string $ToPath, array $Files): bool
Copies files and/or folders from one folder to another.
Copies files and/or folders from one folder to another.
Parameters
$UserId |
User identifier.
|
$FromType |
storage type of folder items will be copied from.
|
$ToType |
storage type of folder items will be copied to.
|
$FromPath |
folder items will be copied from.
|
$ToPath |
folder items will be copied to.
|
$Files |
list of items to copy {
string Name Name of item to copy.
bool IsFolder Indicates if the item to copy is folder or not.
}
|
Throws
|
#
|
public
|
Move(int $UserId, string $FromType, string $ToType, string $FromPath, string $ToPath, array $Files): bool
Moves files and/or folders from one folder to another.
Moves files and/or folders from one folder to another.
Parameters
$UserId |
User identifier.
|
$FromType |
storage type of folder items will be moved from.
|
$ToType |
storage type of folder items will be moved to.
|
$FromPath |
folder items will be moved from.
|
$ToPath |
folder items will be moved to.
|
$Files |
list of items to move {
string Name Name of item to copy.
bool IsFolder Indicates if the item to copy is folder or not.
}
|
Throws
|
#
|
public
|
CreatePublicLink(int $UserId, string $Type, string $Path, string $Name, int $Size, bool $IsFolder): string|false
Creates public link for file or folder.
Creates public link for file or folder.
Parameters
$UserId |
User identifier.
|
$Type |
Type of storage contains the item.
|
$Path |
Path to the item.
|
$Name |
Name of the item.
|
$Size |
Size of the file.
|
$IsFolder |
Indicates if the item is folder or not.
|
Returns
Throws
|
#
|
public
|
DeletePublicLink(int $UserId, string $Type, string $Path, string $Name): bool
Deletes public link from file or folder.
Deletes public link from file or folder.
Parameters
$UserId |
User identifier.
|
$Type |
Type of storage contains the item.
|
$Path |
Path to the item.
|
$Name |
Name of the item.
|
Throws
|
#
|
public
|
CheckUrl(string $Url): array|bool
Checks URL and returns information about it.
Checks URL and returns information about it.
Parameters
Returns
{
Name
Thumb
Size
LinkType
}
|
#
|
public
|
GetFilesForUpload($UserId, $Hashes = []): array
|
#
|
public
|
IsFileExists(int $UserId, string $Type, string $Path, string $Name)
Checks if file exists.
|
#
|
public
|
GetNonExistentFileName(int $UserId, string $Type, string $Path, string $Name, $WithoutGroup = false)
|
#
|
public
|
SaveFilesAsTempFiles(type $UserId, $Files)
|
#
|
public
|
UpdateSettingsForEntity($EntityType, $EntityId, $UserSpaceLimitMb, $TenantSpaceLimitMb)
|
#
|
public
|
UpdateUserSpaceLimit($UserId, $Limit)
|
#
|
public
|
UpdateTenantSpaceLimit($TenantId, $Limit)
|
#
|
public
|
GetAllocatedSpaceForUsersInTenant($TenantId)
|
#
|
public
|
CheckAllocatedSpaceLimitForUsersInTenant($oTenant, $UserSpaceLimitMb)
|
#
|
public
|
UpdateExtendedProps(int $UserId, string $Type, string $Path, string $Name, array $ExtendedProps): bool
Update ExtendedProps
Parameters
$Type |
Type of storage contains the item.
|
$Path |
Path to the item.
|
$Name |
Name of the item.
|
|
#
|
public
|
GetExtendedProps($UserId = null, $Type = null, $Path = null, $Name = null)
|
#
|
public
|
GetAccessInfoForPath($UserId, $Type, $Path)
|
#
|