Skip to content

createRemoteAttachmentFromFile

createRemoteAttachmentFromFile(unencryptedFile, uploadCallback): Promise<RemoteAttachment>

Defined in: sdks/js/agent-sdk/src/util/AttachmentUtil.ts:67

Creates a remote attachment from a file by encrypting it and uploading it to a remote storage. This is a convenience function that combines file processing, encryption, uploading, and remote attachment creation into a single operation.

File

The unencrypted file to process and upload

AttachmentUploadCallback

A callback function that receives the encrypted attachment and returns the URL where it was uploaded

Promise<RemoteAttachment>

A promise that resolves with a remote attachment containing all necessary metadata for retrieval and decryption