]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix pgsql error
authorFlorin Peter <github@florin-peter.de>
Wed, 22 May 2013 00:02:42 +0000 (02:02 +0200)
committerFlorin Peter <github@florin-peter.de>
Wed, 22 May 2013 00:02:42 +0000 (02:02 +0200)
apps/files_encryption/lib/util.php

index 1f4609ae2f68a2f24a39da65d9307156b515ac15..784d74bd759ca1383c3f3aba81e795bab0536fbf 100644 (file)
@@ -706,13 +706,16 @@ class Util
                                // NOTE: Stream{} will be invoked for handling 
                                // the encryption, and should handle all keys 
                                // and their generation etc. automatically
-                               $size = stream_copy_to_stream($plainHandle2, $encHandle);
+                               stream_copy_to_stream($plainHandle2, $encHandle);
+
+                               // get file size
+                               $size = $this->view->filesize($rawPath . '.plaintmp');
 
                                // Delete temporary plain copy of file
                                $this->view->unlink($rawPath . '.plaintmp');
 
                                // Add the file to the cache
-                               \OC\Files\Filesystem::putFileInfo($plainFile['path'], array('encrypted' => true, 'size' => $size), '');
+                               \OC\Files\Filesystem::putFileInfo($plainFile['path'], array('encrypted' => true, 'size' => $size, 'unencrypted_size' => $size));
                        }
 
                        // Encrypt legacy encrypted files