mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 12:12:55 -06:00
Merge pull request #1344 from alvestassio/fix/multiple-files-sent-via-whatsapp
Adicionando um timestamp ao filename para possibilitar enviar o mesmo arquivo mais de uma vez na mesma conversa.
This commit is contained in:
commit
9889035ddc
@ -1332,7 +1332,12 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
|
|
||||||
const { buffer, mediaType, fileName, size } = media;
|
const { buffer, mediaType, fileName, size } = media;
|
||||||
const mimetype = mimeTypes.lookup(fileName).toString();
|
const mimetype = mimeTypes.lookup(fileName).toString();
|
||||||
const fullName = join(`${this.instance.id}`, received.key.remoteJid, mediaType, fileName);
|
const fullName = join(
|
||||||
|
`${this.instance.id}`,
|
||||||
|
received.key.remoteJid,
|
||||||
|
mediaType,
|
||||||
|
`${Date.now()}_${fileName}`,
|
||||||
|
);
|
||||||
await s3Service.uploadFile(fullName, buffer, size.fileLength?.low, {
|
await s3Service.uploadFile(fullName, buffer, size.fileLength?.low, {
|
||||||
'Content-Type': mimetype,
|
'Content-Type': mimetype,
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user