Copying (COPY)

Use the COPY method to copy files and directories within the Yandex Disk file structure.

Example: the lion.png file is copied from the pictures folder to the animals folder.

COPY /pictures/lion.png HTTP/1.1
Host: webdav.yandex.ru
Accept: */*
Authorization: OAuth 0c4181a7c2cf4521964a72ff57a34a07
Destination: /animals/lion.png

The Overwrite header can be set in order to prevent overwriting an existing file with the same name. The value "T" (by default) allows overwriting, and the value "F" forbids it. If the /pictures/ directory already has the lion.png file, the request from the example will not be completed.

If copying was completed successfully, the following response is returned:

HTTP/1.1 201 Created
Content-Length: 0