Skip to content

Commit

Permalink
Merge pull request #39679 from nextcloud/backport/39672/stable26
Browse files Browse the repository at this point in the history
[stable26] fix(dav): use quota of destination in s3 chunk upload
  • Loading branch information
nickvergessen authored Aug 2, 2023
2 parents c908faa + e9c9fb4 commit b5ebcea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/dav/lib/Upload/ChunkingV2Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function beforePut(RequestInterface $request, ResponseInterface $response
[$destinationDir, $destinationName] = Uri\split($this->uploadPath);
/** @var Directory $destinationParent */
$destinationParent = $this->server->tree->getNodeForPath($destinationDir);
$free = $storage->free_space($destinationParent->getInternalPath());
$free = $destinationParent->getNode()->getFreeSpace();
$newSize = $tempTargetFile->getSize() + $additionalSize;
if ($free >= 0 && ($tempTargetFile->getSize() > $free || $newSize > $free)) {
throw new InsufficientStorage("Insufficient space in $this->uploadPath");
Expand Down Expand Up @@ -225,7 +225,7 @@ public function beforeMove($sourcePath, $destination): bool {
foreach ($parts as $part) {
$size += $part['Size'];
}
$free = $storage->free_space($destinationParent->getInternalPath());
$free = $destinationParent->getNode()->getFreeSpace();
if ($free >= 0 && ($size > $free)) {
throw new InsufficientStorage("Insufficient space in $this->uploadPath");
}
Expand Down

0 comments on commit b5ebcea

Please sign in to comment.