mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Merge pull request #6081 from owncloud/partfilewebdavfix
Allow getting info or renaming part files through WebDAV
This commit is contained in:
commit
bd6734291c
1 changed files with 14 additions and 1 deletions
|
|
@ -38,7 +38,20 @@ class ObjectTree extends \Sabre_DAV_ObjectTree {
|
|||
return $this->rootNode;
|
||||
}
|
||||
|
||||
$info = $this->getFileView()->getFileInfo($path);
|
||||
if (pathinfo($path, PATHINFO_EXTENSION) === 'part') {
|
||||
// read from storage
|
||||
$absPath = $this->getFileView()->getAbsolutePath($path);
|
||||
list($storage, $internalPath) = Filesystem::resolvePath('/' . $absPath);
|
||||
if ($storage) {
|
||||
$scanner = $storage->getScanner($internalPath);
|
||||
// get data directly
|
||||
$info = $scanner->getData($internalPath);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// read from cache
|
||||
$info = $this->getFileView()->getFileInfo($path);
|
||||
}
|
||||
|
||||
if (!$info) {
|
||||
throw new \Sabre_DAV_Exception_NotFound('File with name ' . $path . ' could not be located');
|
||||
|
|
|
|||
Loading…
Reference in a new issue