the directory in which the temporary files are stored. Must be read- and write accessible
Optional
options: { invalidCharactersRegexp?: RegExp; maxPathLength?: number }Optional
invalidCharactersRegexp?: RegExpThese characters will be removed from files that are saved to S3. There is a very strict default list that basically only leaves alphanumeric filenames intact. Should you need more relaxed settings you can specify them here.
Optional
maxPathLength?: numberProtected
Optional
optionsOptional
invalidCharactersRegexp?: RegExpThese characters will be removed from files that are saved to S3. There is a very strict default list that basically only leaves alphanumeric filenames intact. Should you need more relaxed settings you can specify them here.
Optional
maxPathLength?: numberDeletes the file from temporary storage (e.g. because it has expired)
the filename; can be a path including subdirectories (e.g. 'images/xyz.png')
(optional) when there is no user deleting, you must specify who the owner of the temporary file is; only needed when userId is null
true if deletion was successful
Checks if a file exists in temporary storage.
the filename to check; can be a path including subdirectories (e.g. 'images/xyz.png')
the user for who to check
true if file already exists
Returns a information about a temporary file. Throws an exception if the file does not exist.
the relative path inside the library
the user who wants to access the file
the file stats
Returns the contents of a file. Must check for access permissions and throw an H5PError if a file is not accessible.
the filename; can be a path including subdirectories (e.g. 'images/xyz.png')
the user who accesses the file
Optional
rangeStart: number(optional) the position in bytes at which the stream should start
Optional
rangeEnd: number(optional) the position in bytes at which the stream should end
the stream containing the file's content
Returns a list of files in temporary storage for the specified user. If the user is undefined or null, lists all files in temporary storage.
Optional
user: IUser(optional) Only list files for the user. If left out, will list all temporary files.
a list of information about the files
Removes invalid characters from filenames and enforces other filename rules required by the storage implementation (e.g. filename length restrictions).
the filename to sanitize; this can be a relative path (e.g. "images/image1.png")
the clean filename
Stores a file. Only the user who stores the file is allowed to access it later.
the filename by which the file will be identified later; can be a path including subdirectories (e.g. 'images/xyz.png')
the stream containing the file's data
the user who is allowed to access the file
when the file ought to be deleted
an object containing information about the stored file; undefined if failed
Stores temporary files in directories on the disk. Manages access rights by creating one sub-directory for each user. Manages expiration times by creating companion '.metadata' files for every file stored.