I want to upload the document to the VK server. Read off. documentation It is done in several stages. For starters, we get a server address through a request to download our file. I got the address. Next, we must send a POST request (with multipart data) with this file and then finish saving this file using the VkApi.docs (). Save () method. I do not know how to send a post request. I tried various ways (using the okhttp libraries, etc.) - it doesn't work. Maybe someone has a working example?

    1 answer 1

    Once no one answered, I will write the solution I found. At the entrance to the described method is a file that needs to be loaded into the VC.

    public void SendDocToServer(File file){ VKApiDocs docs = new VKApiDocs(); VKRequest request = docs.uploadDocRequest(file); request.executeWithListener(new VKRequest.VKRequestListener(){ @Override public void onComplete(VKResponse response){ super.onComplete(response); //Файл загружен успешно } }); }