@pod-os/core / FileGateway
Class: FileGateway
Defined in: files/FileGateway.ts:13
Gateway for file-related operations on Solid Pods and the store.
Since
0.24.0
Constructors
Constructor
new FileGateway(
store,fileFetcher):FileGateway
Defined in: files/FileGateway.ts:14
Parameters
store
fileFetcher
Returns
FileGateway
Methods
uploadAndLinkFile()
uploadAndLinkFile(
thing,predicateUri,fileToUpload):ResultAsync\<NewFile,NetworkProblem|HttpProblem>
Defined in: files/FileGateway.ts:29
Uploads a file and associates it with a thing. The container is automatically derived from the thing's URI. Uses schema:image as the predicate.
Parameters
thing
The thing to add the file to
predicateUri
string
The URI of the predicate to use
fileToUpload
File
The file to upload
Returns
ResultAsync\<NewFile, NetworkProblem | HttpProblem>
Result with the uploaded metadata (url, name, contentType) or error