mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
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:
1 parent
9681c62ae8
commit
a40a5a500e
1 file changed
+5
-2
+5
-2
@@ -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
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user