J
J
Jiestie2016-04-27 15:03:42
In contact with
Jiestie, 2016-04-27 15:03:42

How to upload a document (GIF animation) via VK API correctly?

At first there were problems with getting the server to download the document... found a link here ,

send a request to docs.getWallUploadServer specifying only the access_token. - then the url for loading the document began to come.... I send a gif to the url, but there is an unknown error in the response... I use the restler module

restler.post(doc_upl_serv, {
    multipart: true,
    data: {
        'file1':restler.data('doodle.'+cr,gf.headers['content-length'], data)
    }
}).on('complete', function(reslt,data) {
    if (reslt instanceof Error) {
        console.log('Error:',reslt.message);
    } else {
        console.log(reslt.headers+"   docs headers");
        grovyGuns.push(reslt);
        calback();
    }
});

Another question, what is the best npm module for requestsov to use? tried different ones. I only managed to post a picture in VK with a wrestler, but it has not been updated for a long time, maybe superagent? Or can someone explain how to make a POST request with multiply/form-data in native node.js ?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question