Closed IgalNeeman closed 3 years ago
its worked its ok. sorry.
its worked its ok. sorry.
bro 🗿🗿
Guys please help me, I tried to set up this module used to download the pdf file sent by the user and save it in the specific folder while keeping the same name of this document but once the process of uploading download the pdf document completed I find that the pdf file is wrong. I'm sending you screenshots of the process:
else if (msg.body === '!mediainfo' && msg.hasMedia) {
const attachmentData = await msg.downloadMedia();
msg.reply( *Media info* MimeType: ${attachmentData.mimetype} Filename: ${attachmentData.filename} Data (length): ${attachmentData.data.length}
);
try {
// Download the media (PDF file) and save it to the ./document folder
const mediaBuffer = await msg.downloadMedia();
const filePath = ./document/${attachmentData.filename};
// Write the buffer to a file
fs.writeFileSync(filePath, mediaBuffer.data);
console.log(Media downloaded and saved to: ${filePath});
} catch (error) {
console.error('Error saving the PDF file:', error);
msg.reply('An error occurred while saving the PDF file.');
@ycodexme : please use this
https://www.npmjs.com/package/@open-wa/wa-decrypt?activeTab=readme
It works perfect.
hello, if i send my file cv to the bot its not working , not with: !mediainfo its not downloading the file.
in the file Example.js:
its not working...
CONSOLE.LOG:
MESSAGE RECEIVED Message { mediaKey: 'KPgPZnfFJzES0eWHBxhq/X/HSQ7i1migfIMYE4Wn/8Q=', id: { fromMe: false, remote: '972526020093@c.us', id: '3EB097F05C684A2516D8', _serialized: 'false_972526020093@c.us_3EB097F05C684A2516D8' }, ack: -1, hasMedia: true, body: 'igal-n - old.pdf', type: 'document', timestamp: 1606842562, from: '972526020093@c.us', to: '972527972028@c.us', author: undefined, isForwarded: false, isStatus: false, broadcast: false, fromMe: false, hasQuotedMsg: false, location: undefined, vCards: [], mentionedIds: [] }
where is the file Downloaded? if yes? and how can i use it ? thank you