Hooray! Hooray! Hooray! The question has been resolved again :) True, I will immediately say, gentlemen, that here it is much more difficult than what I decided before - tyk .
Attention : we will make all requests with cookies. Without them - no way.
In general, let's go:
We get a link to download our carpet (in VK the header is called cover) :
- We make the request here:
https://vk.com/al_page.php - In headers we attach our cookies
- We write this in the body of the POST request:
act=owner_photo_box&al=1&cover=1&oid=-id вашей группы - If everything went well, we get about this page in response:

- At the end of the page there will be links. We need the first one (comes immediately after OwnerPhoto.uploadInit ). See screenshot:

Our link turned out to be this: https:\/\/pu.vk.com\/c837731\/upload.php?act=owner_cover&oid=-136618761&square=&mid=151665536&server=837731&_origin=https%3A%2F%2Fvk.com&_sig=c55042259e8ee7c612cdcd9861961cdf
We upload our photos to VK servers using the link obtained in the previous paragraph :
How to upload a file in multipart / form-data format I described here (the standard Java library) or much shorter and more beautifully can be downloaded using the OkHttp library - the process is described here .
ATTENTION: now VK accepts pictures only with the file field in the post-request! So (here in Java) - multipart.addFilePart ("file", uploadFile1);
If the picture is in a field with a different name, you will receive the following error:
{"error": "ERR_UPLOAD_FILE_NOT_UPLOADED: file not found", "bwact": "owner_cover", "server": 638219, "mid": 151665536, "_ sig": "9417bfeb4cca32304ed587818dd191931"}
In response, we will receive a description of our pictures in this format:
`{"oid":"-136618761","photo":{"photo":"6fae155614x","sizes":[["x","837731536","18af4","9lzKWBYrE2w",795,1060],["y","837731536","18af5","8knjXW2i2K8",810,1080],["o","837731536","18af6","-w20s8JJGNA",810,1080]],"kid":"9d20ccbaa7b6ec6d7171716dcd5bade1","debug":"xxoyooo"},"x_src":"v837731536\/18af4\/9lzKWBYrE2w.jpg","x_size":[795,1060],"size":[810,1080],"bwact":"owner_cover","server":837731,"mid":151665536,"_sig":"fe9a46f1b2e26f4a1c56bbc36850a10e"}`
Save our work of art :
- We take the first part of our link, obtained in the first paragraph with the server number, and substitute to it act = owner_cover_crop & _query = and the description of our photo , obtained from the point above. In our case it looks like this:
https://pu.vk.com/c837731/upload.php?act=owner_cover_crop&_query={"oid":"-136618761","photo":{"photo":"2b522d8e86x","sizes":[["x","837731536","18aa5","tuY07_54Ovk",795,497],["y","837731536","18aa6","RxPs7YD5hCs",1590,994],["o","837731536","18aa7","nmZ4LwQDbgw",2880,1800]],"kid":"621fad611afefb9048b478bcc627ab12","debug":"xxoyooo"},"x_src":"v837731536\/18aa5\/tuY07_54Ovk.jpg","x_size":[795,497],"size":[2880,1800],"bwact":"owner_cover","server":837731,"mid":151665536,"_sig":"efb64dcfd413f8e1cd52c86c9ffe98d6"}
This is our URL, which will be accessed.
- Be sure to insert our cookies into the header.
- The answer is:
{"oid":"-136618761","data":["xAAzIYwAAAAAx7sTQAAGK9PZcylgWKxNsYAAGK9fJJ411totivOAAGK9vsNtLPCSRjQAAAGK91LwRyB-lQoPBAAGK-LTMIdOtvbDACAAGK-W1AR45kIrfADAAGK-n6SOgL5ttKpEAAGK-6ApZsVYFCSa","0,0,795,200",0,"810,1080","795,1060"],"bwact":"owner_cover_crop","server":837731,"mid":151665536,"_sig":"7e008ee2a25eaafe4921763ee3b3691d"}
We force VK to obey and insert our long-suffering picture into the header :
- We make a request to this address:
https://vk.com/al_page.php - Be sure to insert cookies into headers
- Insert the line obtained in the paragraph above into the body of the POST request and add _query = before it, followed by & act = owner_photo_save & al = 1 & from = groups . The body will look like this:
_query={"oid":"-136618761","data":["xAAzIYwAAAAAx7sTQAAGKnqTNf2fQ6fuoYAAGKn3Z9dX-ImPaLOAAGKoG1FCgvWBDhHAAAGKqJRsM9D7RwUzBAAGKqWp6mu7odOTZCAAGKqsVKNMJ80uh9DAAGKq99X4PZhrf1wEAAGKrFjQIUH8hRcw","0,536,2880,724",0,"2880,1800","795,497"],"bwact":"owner_cover_crop","server":837731,"mid":151665536,"_sig":"3aeeb1dff8888aed8bf8f65c91568bb0"}&act=owner_photo_save&al=1&from=groups
Watch the resolution of the photo when you upload it. If it doesn’t fit, VK will begin to cut, but you can specify dimensions in requests (I think it’s clear where and how). In general, VK recommends 1590 × 400 ...
Thanks for attention! I hope someone helped ...