diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php
index 7d889fbce580be3e2687f00808c0fb067986cf80..8acfe504cb2725510cb2952f2a20cdcc4cf22a85 100644
--- a/lib/filestorage/local.php
+++ b/lib/filestorage/local.php
@@ -96,9 +96,7 @@ class OC_Filestorage_Local extends OC_Filestorage{
 			$source=substr($path1,strrpos($path1,'/')+1);
 			$path2.=$source;
 		}
-		if($return=copy($this->datadir.$path1,$this->datadir.$path2)){
-		}
-		return $return;
+		return copy($this->datadir.$path1,$this->datadir.$path2);
 	}
 	public function fopen($path,$mode){
 		if($return=fopen($this->datadir.$path,$mode)){
diff --git a/lib/filesystemview.php b/lib/filesystemview.php
index 9f0a88f8ab07903c569ba50a67cfe17aab390e36..b014c3272f744d722d1d7e2a4e0948a0921e82c4 100644
--- a/lib/filesystemview.php
+++ b/lib/filesystemview.php
@@ -173,13 +173,11 @@ class OC_FilesystemView {
 		if(is_resource($data)){//not having to deal with streams in file_put_contents makes life easier
 			$target=$this->fopen($path,'w');
 			if($target){
-				while(!feof($data)){
-					fwrite($target,fread($data,8192));
-				}
+				$count=OC_Helper::streamCopy($data,$target);
 				fclose($target);
 				fclose($data);
 				OC_Hook::emit( OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_write, array( OC_Filesystem::signal_param_path => $path));
-				return true;
+				return $count>0;
 			}else{
 				return false;
 			}
@@ -204,9 +202,7 @@ class OC_FilesystemView {
 				}else{
 					$source=$this->fopen($path1,'r');
 					$target=$this->fopen($path2,'w');
-					while (!feof($source)){
-						fwrite($target,fread($source,8192));
-					}
+					$count=OC_Helper::streamCopy($data,$target);
 					$storage1=$this->getStorage($path1);
 					$storage1->unlink($this->getInternalPath($path1));
 				}
@@ -236,11 +232,7 @@ class OC_FilesystemView {
 				}else{
 					$source=$this->fopen($path1,'r');
 					$target=$this->fopen($path2,'w');
-					if($target and $source){
-						while (!feof($source)){
-							fwrite($target,fread($source,8192));
-						}
-					}
+					$count=OC_Helper::streamCopy($data,$target);
 				}
         OC_Hook::emit( OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_copy, array( OC_Filesystem::signal_param_oldpath => $path1 , OC_Filesystem::signal_param_newpath=>$path2));
 				if(!$exists){