A
A
Alenchik72019-06-16 19:00:20
Python
Alenchik7, 2019-06-16 19:00:20

How to make file transfer in VKontakte using Vk api on python3?

From the documentation:
"File
Upload Upload files to the upload_url obtained in the previous step by making a POST request with a photo field. This field must contain images in multipart/form-data format."
How to write this in python3?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Bushmanov, 2019-06-17
@assanti

https://2.python-requests.org/en/master/user/quick...

I
igorspesh, 2019-06-19
@igorspesh

1) you need to get the server url using the docs.getUploadServer method !! a token with rights to docs
2) send a photo to the received url with a request of this kind requests.post(url, files=file)
3) upload the photo using the / docs.save method

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question