IStorage.upload() method
Uploads a file to the storage.
Signature:
upload(data: string | FileOrBuffer, contractAddress?: string, signerAddress?: string, options?: {
onProgress: (event: UploadProgressEvent) => void;
}): Promise<string>;
Parameters
Parameter | Type | Description |
---|---|---|
data | string | FileOrBuffer | The data to be uploaded. Can be a file/buffer (which will be loaded), or a string. |
contractAddress | string | (Optional) Optional. The contract address the data belongs to. |
signerAddress | string | (Optional) Optional. The address of the signer. |
options | { onProgress: (event: UploadProgressEvent) => void; } | (Optional) Optional. Upload progress callback. |
Returns:
Promise<string>
- The hash of the uploaded data.