fix: read logo file from disk before uploading (multer uses diskStorage)

req.file.buffer is undefined with diskStorage — must read the temp file
from req.file.path using fs.readFileSync instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Sonnet 4.6 committed 2026-03-25 11:14:17 +01:00
1 parent 9681c62ae8
commit a40a5a500e
1 file changed
+5 -2
+5 -2
View File
@@ -1726,9 +1726,12 @@ export async function registerRoutes(app: Express): Promise<Server> {
} }
} }
// Upload new logo to Cloudinary // Read from disk (multer uses diskStorage, not memoryStorage)
const logoBuffer = await fs.promises.readFile(req.file.path);
await fs.promises.unlink(req.file.path).catch(() => {});
const uploadResult = await cloudinaryService.uploadLogo( const uploadResult = await cloudinaryService.uploadLogo(
req.file.buffer, logoBuffer,
req.file.originalname req.file.originalname
); );