Deletes 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
Optional
sanitizeRemoves invalid characters from filenames and enforces other filename rules required by the storage implementation (e.g. filename length restrictions).
the filename to sanitize
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 files uploaded by the user in temporary storage. Note that filenames can be paths like 'images/xyz.png'!