Skip to content

Function: fileFromUrl()

ts
function fileFromUrl(ctx: Context, url: string): Promise<SdkFile>;

Defined in: src/file/getFile.tsx:207

Parameters

ParameterTypeDescription
ctxContextThe Matterway SDK context.
urlstringThe URL of the file to be read.

Returns

Promise<SdkFile>

An SdkFile object that contains the file data and metadata.

Deprecated

Reads a file from a URL and returns an SdkFile object that contains the file data and metadata.

Example

ts
const fileUrl = 'https://example.com/files/example.pdf';
const file = await fileFromUrl(context, fileUrl);
// Now you can use the `file` object as needed.

Matterway Assistant SDK Documentation