]> source.dussan.org Git - nextcloud-server.git/commitdiff
only set the values we need and make sure that we write the file info for both
authorBjoern Schiessle <schiessle@owncloud.com>
Mon, 27 Oct 2014 11:51:52 +0000 (12:51 +0100)
committerBjoern Schiessle <schiessle@owncloud.com>
Fri, 7 Nov 2014 14:20:52 +0000 (15:20 +0100)
the real file and the part file, because some information from the part file
might be needed later

apps/files_encryption/lib/stream.php

index 046c38152b8702e5072c826be250a724224b0f3d..931aa08cb2cd1f3128a3cf5a8fa30494f62b25db 100644 (file)
@@ -637,13 +637,17 @@ class Stream {
                        $path = Helper::stripPartialFileExtension($this->rawPath);
 
                        $fileInfo = array(
+                               'mimetype' => $this->rootView->getMimeType($this->rawPath),
                                'encrypted' => true,
-                               'size' => $this->size,
                                'unencrypted_size' => $this->unencryptedSize,
                        );
 
-                       // set fileinfo
-                       $this->rootView->putFileInfo($path, $fileInfo);
+                       // if we write a part file we also store the unencrypted size for
+                       // the part file so that it can be re-used later
+                       $this->rootView->putFileInfo($this->rawPath, $fileInfo);
+                       if ($path !== $this->rawPath) {
+                               $this->rootView->putFileInfo($path, $fileInfo);
+                       }
 
                }