A
A
Alexey Dagaev2020-06-10 09:18:27
API
Alexey Dagaev, 2020-06-10 09:18:27

How to most effectively upload documents to VK through vk api?

Hello.
I needed to write a script to upload graffiti to VK, and doing this through js + php, I used asynchronous requests from the site to the server, and on the server I already downloaded stickers to the user.

First, I get one upload_url via CURL via the docs.getMessagesUploadServer method with the graffiti type, then I get the second one using the docs.getUploadServer method (a simple file) and upload 2 files using the docs.save method, and the output is graffiti in documents.

The problem with this method is that the execution of the script is very long, despite the fact that I broke the requests into parts. Plus, a captcha pops up, and the execution of the script from the same place is impossible.

The question is - how to do it most efficiently, and perhaps even only through js.
I was prompted about the execute method, but executing it from the server side did not really change the situation. I need a JS example.

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