Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
dav: Fix handling of chunked WebDAV upload
When $data is null (which can happen when $request->getBodyAsStream() returns
null), the Exceptions says "copied bytes: 0, expected filesize: 0", which
sounds more like success...
  • Loading branch information
jplitza authored and Jan-Philipp Litza committed Jan 28, 2019
commit 9348e3d2f693b4f278fb2eb13c225f7ea2bbb9bb
4 changes: 3 additions & 1 deletion apps/dav/lib/Connector/Sabre/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ public function put($data) {
if (isset($_SERVER['CONTENT_LENGTH'])) {
$expected = $_SERVER['CONTENT_LENGTH'];
}
throw new Exception('Error while copying file to target location (copied bytes: ' . $count . ', expected filesize: ' . $expected . ' )');
if ($expected !== "0") {
throw new Exception('Error while copying file to target location (copied bytes: ' . $count . ', expected filesize: ' . $expected . ' )');
}
}

// if content length is sent by client:
Expand Down