Skip to main content

IStorage.uploadBatch() method

Uploads a folder to storage.

Signature:

uploadBatch(files: (string | FileOrBuffer)[], fileStartNumber?: number, contractAddress?: string, signerAddress?: string, options?: {
onProgress: (event: UploadProgressEvent) => void;
}): Promise<UploadResult>;

Parameters

ParameterTypeDescription
files(string | FileOrBuffer)[]An array of the data to be uploaded. Can be a files or buffers (which will be loaded), or strings. (can be mixed, too)
fileStartNumbernumber(Optional) Optional. The first file file name begins with.
contractAddressstring(Optional) Optional. The contract address the data belongs to.
signerAddressstring(Optional) Optional. The address of the signer.
options{ onProgress: (event: UploadProgressEvent) => void; }(Optional) Optional. Upload progress callback.

Returns:

Promise<UploadResult>

  • The CID of the uploaded folder.