[Pkg-owncloud-commits] [owncloud] 114/239: adding chunked upload handling

David Prévot taffit at moszumanska.debian.org
Fri Nov 29 01:32:26 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 27cc333dfef71a4331ad66fa7ce0b1de53e73099
Author: Thomas Müller <thomas.mueller at tmit.eu>
Date:   Mon Nov 25 15:35:26 2013 +0100

    adding chunked upload handling
---
 lib/private/connector/sabre/filesplugin.php | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/private/connector/sabre/filesplugin.php b/lib/private/connector/sabre/filesplugin.php
index 1c80ebe..6523104 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();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list