Create an managed FileUpload object
The FilesAPI instance to use
The name of the file being uploaded
The size of the file being uploaded in bytes
The amount of parallel uploads to use, do not set this too high, or you risk getting rate limited
Should the upload be cancelled if an error occurs?
The seed to use for encryption, if not provided, a random seed will be generated
Static
Readonly
ACTUAL_The size of each chunk to upload, minus the AES header size.
Static
Readonly
CHUNK_The size of each chunk to upload.
Cancel the upload. This action is not immediate, and could take a few moments to complete. The reason behind this is that wee need to wait for the threads to finish their current task, before they check if they should cancel.
A promise that resolves when the cancellation request is sent
Get the amount of chunks this file will be split into
The amount of chunks
Get the size of the file after encryption
The size of the file after encryption
Get the file ID
The file ID
Get the seed used for encryption. Needed for decryption.
The seed, handle with care.
Is the upload finished?
True if the upload is finished
Is the upload started?
True if the upload is started
Set a hook that is called when the progress of the upload changes.
The hook to call
If the current upload is crashed, or you want to resume another upload, you can use this method.
The function to get bytes from the file
Optional
opt: { id?: string; progress?: FileUploadProgress }Options for the resume operation
A promise that resolves when the upload is completed
Start the upload process.
The function to get bytes from the file
A promise that resolves when the upload is completed
The FileUpload class is a helper to split files into chunks, encrypt them, and upload them to the server.