Skip to content

Commit

Permalink
Merge pull request #39678 from nextcloud/backport/39672/stable27
Browse files Browse the repository at this point in the history
[stable27] fix(dav): use quota of destination in s3 chunk upload
  • Loading branch information
blizzz committed Aug 2, 2023
2 parents e33ac4e + 4f2a538 commit 5c6bc1e
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 5c6bc1e

Please sign in to comment.