M
M
Mars362021-03-05 17:27:30
Yandex.Disk
Mars36, 2021-03-05 17:27:30

Getting a url and uploading a file to Yandex disk REST API?

The documentation says that, first you need to get a link to download the file and then use the link to download the file itself. The path to the file in the first request must be specified in the form

The path where the file should be loaded. For example, %2Fbar%2Fphoto.png. The maximum length of the uploaded file name is 255 characters; the maximum path length is 32760 characters.

The path in the parameter value must be URL-encoded.

If you try to enter a path like %2Fhome%2Fuser%2Fimage.png into the path field on the polygon, then in the link it is already encoded as %252Fhome%252Fuser%252Fimage.png , which is not from the documentation. If you enter /home/user/image.png, then it swears that there is no path (if you try to enter the path of the disk, it will recognize it and say, for example, that disk:/image.png exists. That is, in the first request you need to specify But in the second request on the polygon, the path parameter is described as a place to download the file and in the same way swears on the path of the local disk, besides, the documentation says that the second request must be sent by the put method, and in the polygon it is specified as post, it turns out these requests are not related to each other? Or am I doing something wrong?
Description of the download in the documentation: https://uploader23j.disk.yandex.net:443/upload-tar... "

Upload methods on
polygon

60423f5f68369250087566.png

If these methods in the polygon are not connected, then how to send a request for downloads? Where to put the received link in the request and how to correctly write the path to the file on the local disk?

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