OptionalidOptionaluser_Staticfixed_Staticsandbox_Get current folder
MIME type of the file
Get path to serve
Delete file
Optionalunlinker: (arg0: File) => Promise<void>Move file to other folder
target folder for file
Rename file
target file name
Set Min Role to read for file
target Role for file to read
Set user for file
target user_id
StaticabsStaticallget all directories in the root folder (tenant root dir for multi-tenant)
OptionalignoreCache: booleanif a cache exists, ignore it
StaticbuildStaticcheck_If a sandbox directory is configured on this (sub)class (via File.subClass({ sandbox_dir })), ensure that the given absolute path lies inside the sandbox directory (or is the sandbox directory itself). This is used to confine untrusted code to a directory tree: any File method that touches the filesystem routes the path it is about to access through this guard. Throws if the path escapes the sandbox.
Symlinks are resolved (on the longest existing prefix of the path) so that a symlink inside the sandbox cannot be used to read or write outside of it.
When no sandbox_dir is set this is a no-op and returns the path unchanged.
absolute filesystem path that is about to be accessed
the resolved path
StaticcreateStaticdestroyStaticensure_Ensure that file_store path is physically exists in file system. In reality just recursively creates full absolute path to db.connectObj.file_store.
Optionaltenant_name: stringStaticfieldOptionalrelPath: stringStaticfindSelect list of file descriptors
Optionalwhere: WhereStaticfindStaticfrom_Create new file
Staticfrom_Staticfrom_Create new file
Staticget_Get absolute path to new file in db.connectObj.file_store.
Optionalsuggest: stringpath to file inside file store. If undefined that autogenerated uudv4 is used.
OptionalrenameIfExisting: booleanStaticgetStaticisOptionalvalue: stringStaticnameStaticnew_Create new folder
StaticnormaliseStaticnormalise_StaticnormalizeOptionalvalue: stringStaticpathStaticreallyStaticrelativeOptionalvalue: stringStaticrootStaticset_StaticsubStaticsubStaticupdateUpdate File descriptor
primary key
row data
no returns
Staticupdate_StaticuploadThis is a mobile-app function, it uploads a file to the saltcorn server.
file to upload
JSON response from POST 'file/upload'
File Descriptor class
Architecture tips: