Open CSFelix opened 2 weeks ago
Bug Description
Files are Downloaded as Invalid-File in Whatsapp for Windows Desktop
Reproduction
invalid_file.txt
Expected behavior
The document should be downloaded with its original content and mimetype.
Environment
The bug happened on both: server and localhost
connectOptions
wsocket = makeWASocket({ logger: loggerBaileys, printQRInTerminal: false, auth: state as AuthenticationState, generateHighQualityLinkPreview: false, syncFullHistory: true, markOnlineOnConnect: true, patchMessageBeforeSending: message => { const requiresPatch = !!( message.buttonsMessage || message.listMessage ); if (requiresPatch) { message = { viewOnceMessage: { message: { messageContextInfo: { deviceListMetadataVersion: 2, deviceListMetadata: {} }, ...message } } }; } return message; }, getMessage });
Nope
Additional context
images, videos, stickers and gifs work fine, the problem is related only to documents, such as PDFs, TXTs, ZIPs and RARs;
images, videos, stickers and gifs
This sample from my code sends a PDF File to a contact.
const quoted = { quoted: { key: <quotedMessage.Key>, message: <quotedMessage.Message> } }; const options = { document: fs.readFileSync(media.path), caption: "pdf file - caption", fileName: "pdf file - name", mimetype: "application/pdf" }; const sentMessage = await sock.sendMessage( <jid>, { ...options }, { ...quoted } );
up
Bug Description
Files are Downloaded as Invalid-File in Whatsapp for Windows Desktop
Reproduction
invalid_file.txt
;Expected behavior
The document should be downloaded with its original content and mimetype.
Environment
The bug happened on both: server and localhost
connectOptions
look like?Nope
Nope
Additional context
images, videos, stickers and gifs
work fine, the problem is related only to documents, such as PDFs, TXTs, ZIPs and RARs;This sample from my code sends a PDF File to a contact.