Answer the question
In order to leave comments, you need to log in
How to send a document to VK with the desired extension?
To upload a document to a group, I use the following code:
async function uploadDoc(g_Id, srs, ttle)
{
return u_vk.upload.document({
group_id: g_Id,
source: srs,
title: ttle
})
.then((doc) => {
console.log('Success upload', doc);
return doc;
})
.catch(console.error);
}
await uploadDoc(publicId, __dirname + '\\' + msg.senderId + '.cpp', msg.senderId + '.cpp');
Answer the question
In order to leave comments, you need to log in
async function uploadDoc(g_Id, srs, ttle)
{
return u_vk.upload.document({
group_id: g_Id,
source: {
value: srs,
filename: ttle
},
title: ttle
})
.then((doc) => {
console.log('Success upload', doc);
return doc;
})
.catch(console.error);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question