mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-14 22:48:10 +01:00
🖼️ fix: Clipboard Files & File Name Issues (#2015)
* fix: ensure image handling fetchs image to base64 for multiple images * fix: append file_id's when writing uploaded files * feat: timestamp files uploaded from clipboard * chore: add a different fileid+name separator
This commit is contained in:
parent
18edd2660b
commit
40e884b3ec
5 changed files with 31 additions and 18 deletions
|
|
@ -26,7 +26,7 @@ const { logger } = require('~/config');
|
|||
* - width: The width of the converted image.
|
||||
* - height: The height of the converted image.
|
||||
*/
|
||||
async function uploadImageToFirebase({ req, file, endpoint, resolution = 'high' }) {
|
||||
async function uploadImageToFirebase({ req, file, file_id, endpoint, resolution = 'high' }) {
|
||||
const inputFilePath = file.path;
|
||||
const inputBuffer = await fs.promises.readFile(inputFilePath);
|
||||
const {
|
||||
|
|
@ -38,7 +38,7 @@ async function uploadImageToFirebase({ req, file, endpoint, resolution = 'high'
|
|||
const userId = req.user.id;
|
||||
|
||||
let webPBuffer;
|
||||
let fileName = path.basename(inputFilePath);
|
||||
let fileName = `${file_id}__${path.basename(inputFilePath)}`;
|
||||
if (extension.toLowerCase() === '.webp') {
|
||||
webPBuffer = resizedBuffer;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue