diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-07-27 12:14:18 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-07-27 19:35:28 +0200 |
commit | 1ea33ff36bf70ee2099f8d225f488dc220e3bcff (patch) | |
tree | 2ca34ad9fef5a0ee8a637f2e70dd75f0dcd27bcc /lib/connector/sabre/directory.php | |
parent | 2d85ef0e045380691b1dcf136b4b61b46104c2c6 (diff) | |
download | nextcloud-server-1ea33ff36bf70ee2099f8d225f488dc220e3bcff.tar.gz nextcloud-server-1ea33ff36bf70ee2099f8d225f488dc220e3bcff.zip |
Chunked upload: Refactor OC_FileChunking to object
Diffstat (limited to 'lib/connector/sabre/directory.php')
-rw-r--r-- | lib/connector/sabre/directory.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php index b88d0f32864..09c65f19b80 100644 --- a/lib/connector/sabre/directory.php +++ b/lib/connector/sabre/directory.php @@ -49,12 +49,13 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa */ public function createFile($name, $data = null) { if (isset($_SERVER['HTTP_OC_CHUNKED'])) { - OC_FileChunking::store($name, $data); $info = OC_FileChunking::decodeName($name); - if (OC_FileChunking::isComplete($info)) { + $chunk_handler = new OC_FileChunking($info); + $chunk_handler->store($info['index'], $data); + if ($chunk_handler->isComplete()) { $newPath = $this->path . '/' . $info['name']; $f = OC_Filesystem::fopen($newPath, 'w'); - OC_FileChunking::assemble($info, $f); + $chunk_handler->assemble($f); return OC_Connector_Sabre_Node::getETagPropertyForPath($newPath); } } else { |