(
base64Data: string,
mimeType: string,
fileName: string,
options: ICommonObject
)
| 66 | |
| 67 | /** Saves raw base64 data to storage as a file. Returns the file path, name, and size. */ |
| 68 | const 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 |
no test coverage detected