MCPcopy
hub / github.com/FlowiseAI/Flowise / saveImageToStorage

Function saveImageToStorage

packages/components/nodes/agentflow/utils.ts:68–84  ·  view source on GitHub ↗
(
    base64Data: string,
    mimeType: string,
    fileName: string,
    options: ICommonObject
)

Source from the content-addressed store, hash-verified

66
67/** Saves raw base64 data to storage as a file. Returns the file path, name, and size. */
68const saveImageToStorage = async (
69 base64Data: string,
70 mimeType: string,
71 fileName: string,
72 options: ICommonObject
73): Promise<ISavedImageResult> => {
74 const imageBuffer = Buffer.from(base64Data, 'base64')
75 const { path, totalSize } = await addSingleFileToStorage(
76 mimeType,
77 imageBuffer,
78 fileName,
79 options.orgId,
80 options.chatflowid,
81 options.chatId
82 )
83 return { filePath: path, fileName, totalSize }
84}
85
86// ─── Processing stored-file references into base64 for model invocation ──────
87

Callers 2

saveBase64ImageFunction · 0.85
saveGeminiInlineImageFunction · 0.85

Calls 1

addSingleFileToStorageFunction · 0.90

Tested by

no test coverage detected