aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-11-25 15:35:26 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2013-11-25 15:35:26 +0100
commit27cc333dfef71a4331ad66fa7ce0b1de53e73099 (patch)
tree57c24e9c2da1e25aeb1dc7e4cee3e73cede4739d /lib
parent31d0ba03449bd0f6b8f245e456e8ba83b99413cf (diff)
downloadnextcloud-server-27cc333dfef71a4331ad66fa7ce0b1de53e73099.tar.gz
nextcloud-server-27cc333dfef71a4331ad66fa7ce0b1de53e73099.zip
adding chunked upload handling
Diffstat (limited to 'lib')
-rw-r--r--lib/private/connector/sabre/filesplugin.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/private/connector/sabre/filesplugin.php b/lib/private/connector/sabre/filesplugin.php
index 1c80ebe8044..65231040fb5 100644
--- a/lib/private/connector/sabre/filesplugin.php
+++ b/lib/private/connector/sabre/filesplugin.php
@@ -78,7 +78,19 @@ class OC_Connector_Sabre_FilesPlugin extends Sabre_DAV_ServerPlugin
* @throws Sabre_DAV_Exception_BadRequest
*/
public function sendFileIdHeader($filePath, Sabre_DAV_INode $node = null) {
+ // chunked upload handling
+ if (isset($_SERVER['HTTP_OC_CHUNKED'])) {
+ list($path, $name) = \Sabre_DAV_URLUtil::splitPath($filePath);
+ $info = OC_FileChunking::decodeName($name);
+ if (!empty($info)) {
+ $filePath = $path . '/' . $info['name'];
+ }
+ }
+
// we get the node for the given $filePath here because in case of afterCreateFile $node is the parent folder
+ if (!$this->server->tree->nodeExists($filePath)) {
+ return;
+ }
$node = $this->server->tree->getNodeForPath($filePath);
if ($node instanceof OC_Connector_Sabre_Node) {
$fileId = $node->getFileId();