mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix: ensure parent folder exists when writing a file to object storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
e82ab7816f
commit
dd68f678b2
1 changed files with 4 additions and 0 deletions
|
|
@ -495,6 +495,10 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common implements IChunkedFil
|
|||
if ($exists) {
|
||||
$fileId = $stat['fileid'];
|
||||
} else {
|
||||
$parent = $this->normalizePath(dirname($path));
|
||||
if (!$this->is_dir($parent)) {
|
||||
throw new \InvalidArgumentException("trying to upload a file ($path) inside a non-directory ($parent)");
|
||||
}
|
||||
$fileId = $this->getCache()->put($uploadPath, $stat);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue