Answer the question
In order to leave comments, you need to log in
Loading photo vk api, empty "photos_list"?
This is not a question, this is already an answer that I am writing in case someone encounters the same problem, because the answer is not googled, and the description of the VK api simply does not say that you need to specify the file name.
How it doesn't work (a similar example can be found in the documentation of the request module):
const res = await this.req.post({
...this.options,
url: this.ulpoadUrl,
formData: {
file1: await readFile(path),
},
});
const res = await this.req.post({
...this.options,
url: this.ulpoadUrl,
formData: {
file1: {
value: await readFile(path),
options: { filename: 'dwadawd.jpeg' },
},
},
});
Answer the question
In order to leave comments, you need to log in
How about ready implementation ?
const { VK } = require('vk-io');
const vk = new VK({
token: ...
});
// ...
const attachments = await vk.upload.photoAlbum({
source: [path]
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question