From 0326f67f90a65adcfa9d101ccfb3974d5500bea6 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 22 Nov 2018 18:50:59 +0800 Subject: [PATCH] WIP getting PUT with range-requests working for chunked uploades eg. for RAI client With this commit it should work for regular / non-versioned files --- api/src/WebDAV/Server/Filesystem.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/WebDAV/Server/Filesystem.php b/api/src/WebDAV/Server/Filesystem.php index 0e031ed30a..1fefdd50a0 100644 --- a/api/src/WebDAV/Server/Filesystem.php +++ b/api/src/WebDAV/Server/Filesystem.php @@ -523,7 +523,8 @@ class HTTP_WebDAV_Server_Filesystem extends HTTP_WebDAV_Server return "403 Forbidden"; } - $fp = fopen($fspath, "w"); + // for range requests we need to open with "r+" as "w" truncates the file! + $fp = fopen($fspath, empty($options['ranges']) ? "w" : "r+"); return $fp; }