Used to get values for how long temporary files should be stored.
Saves a file to temporary storage. Assigns access permission to the user passed as an argument only.
the original filename of the file to store
the data of the file in a readable stream
the user who requests the file
the new filename (not equal to the filename passed to the method to unsure uniqueness)
Removes temporary files that have expired.
Removes a file from temporary storage. Will silently do nothing if the file does not exist or is not accessible.
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
Protected
generateTries generating a unique filename for the file by appending a id to it. Checks in storage if the filename already exists and tries again if necessary. Throws an H5PError if no filename could be determined.
the filename to check
the user who is saving the file
the unique filename
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 a file stream for temporary file. Will throw H5PError if the file doesn't exist or the user has no access permissions! Make sure to close this stream. Otherwise the temporary files can't be deleted properly!
the file to get
the user who requests 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
a stream to read from
Keeps track of temporary files (images, video etc. upload for unsaved content).