MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / storedFileToBase64

Function storedFileToBase64

packages/components/nodes/agentflow/utils.ts:62–65  ·  view source on GitHub ↗
(fileName: string, mime: string, options: ICommonObject)

Source from the content-addressed store, hash-verified

60
61/** Reads a file from storage and returns a base64 data-URL string. */
62const storedFileToBase64 = async (fileName: string, mime: string, options: ICommonObject): Promise<string> => {
63 const contents = await getFileFromStorage(fileName, options.orgId, options.chatflowid, options.chatId)
64 return 'data:' + mime + ';base64,' + contents.toString('base64')
65}
66
67/** Saves raw base64 data to storage as a file. Returns the file path, name, and size. */
68const saveImageToStorage = async (

Callers 4

_addImagesToMessagesFunction · 0.85

Calls 1

getFileFromStorageFunction · 0.90

Tested by

no test coverage detected