mirror of
https://github.com/nextcloud/server.git
synced 2026-03-26 04:14:20 -04:00
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...
This commit is contained in:
parent
cfdece7833
commit
9348e3d2f6
1 changed files with 3 additions and 1 deletions
|
|
@ -188,7 +188,9 @@ class File extends Node implements IFile {
|
|||
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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue