diff --git a/backend/src/helpers/EncodeFileToBase64.ts b/backend/src/helpers/EncodeFileToBase64.ts new file mode 100644 index 0000000..50db027 --- /dev/null +++ b/backend/src/helpers/EncodeFileToBase64.ts @@ -0,0 +1,6 @@ +import fs from "fs"; + +export const encodeFileToBase64 = (filePath: string) => { + const file = fs.readFileSync(filePath); + return file.toString("base64"); +};