Restore from trash via API

I cannot quite figure out how to restore files from the trashbin via API. Per the documentation, I try to move files from the trash folder to the “special restore folder”. So the destination URI looks like this: …/nextcloud/remote.php/dav/files/USER/restore/IMG_1952.JPG.d1552861684

and the server rightly says “The destination node is not found”. There is no “restore” folder nowhere in my nextcloud_data file tree. And this seems to be a culprit, the MOVE operation as such is working as expected. Moving to any existing folder works just fine.

Here is the link to the documentation I used:
https://docs.nextcloud.com/server/15/developer_manual/client_apis/WebDAV/trashbin.html#restoring-from-the-trashbin

Nextcloud version : 15.0.8
Operating system and version : Debian 9.9
Apache or nginx version : Apache 2.4.24
PHP version : 7.0.33

With development related questions you better try to reach developers on IRC (freenode).

No, destination URI looks like this: …/nextcloud/remote.php/dav/trashbin/USER/restore/IMG_1952.JPG.d1552861684

And you need to add header ‘Overwrite: T’
curl -H ‘Overwrite: T’ -H ‘Destination: …’ …

work fine for me

1 Like