shareMultiFile()

Syntax

shareMultiFile(
  toPublicKey: string,
  fileList: Array<FileForShare>,
  fileType: UploadType
)

This method allows sharing of multiple files which have the same file type (unencrypt or encrypt).

Note: can't share files with yourself

Parameters

Name
Type
Required
Description

toPublicKey

string

Yes

The public key of user who is shared.

fileList

Array<FileForShare>

Yes

List of file to shares

fileType

string

Yes

The type of file is "ENCRYPT" or "UNENCRYPTED".

fileType has two values as below:

const FILE_TYPE = ["UNENCRYPTED", "ENCRYPT"];

Type FileForShare has the structure like this:

interface FileForShare {
  fileId: string; // file ID
  encryptKey: string; // encrypt key of file
}

Example

Response of example:

Last updated