How can I move a file in "own cloud" to another folder using php ? I have uploaded the files to owncloud using the webdav api. Is there any useful tutorials available for the same
1 Answers
2
votes
You could use the copy() and delete() functionality.
http://api.owncloud.org/classes/OCP.Files.Folder.html#copy
Here is an example as requested...Not to complicated.
public function copy($path1, $path2) {
if ($this->is_dir($path1)) {
return false;
}
return copy($this->getSourcePath($path1), $this->getSourcePath($path2));
}
You can see their usage in their source code. https://github.com/owncloud/core/blob/d6ee1798cc5f9a641344f9e81bd3d770c6875e58/tests/lib/files/storage/copydirectory.php#L27