Skip to content

@pod-os/core


@pod-os/core / AttachmentGateway

Class: AttachmentGateway

Defined in: attachments/AttachmentGateway.ts:11

Gateway for attachment-related operations on Solid Pods and the store.

Since

0.24.0

Constructors

Constructor

new AttachmentGateway(fileGateway): AttachmentGateway

Defined in: attachments/AttachmentGateway.ts:12

Parameters

fileGateway

FileGateway

Returns

AttachmentGateway

Methods

uploadAndAddAttachment()

uploadAndAddAttachment(thing, attachmentFile): ResultAsync\<NewFile, NetworkProblem | HttpProblem>

Defined in: attachments/AttachmentGateway.ts:23

Uploads an attachment file and associates it with a thing. The container is automatically derived from the thing's URI. Uses flow:attachment as the predicate.

Parameters

thing

Thing

The thing to add the attachment to

attachmentFile

File

The attachment file to upload

Returns

ResultAsync\<NewFile, NetworkProblem | HttpProblem>

Result with the uploaded attachment metadata (url, name, contentType) or error