diff --git a/lib/fileproxy/quota.php b/lib/fileproxy/quota.php
index af8ddee1473a525efc4a856a6c74a339ca87ce06..fe3a2333428978ca65d67293f6e24ef4bee45314 100644
--- a/lib/fileproxy/quota.php
+++ b/lib/fileproxy/quota.php
@@ -44,6 +44,9 @@ class OC_FileProxy_Quota extends OC_FileProxy{
 	}
 
 	public function preFile_put_contents($path,$data){
+		if (is_resource($data)) {
+			$data = stream_get_contents($data);
+		}
 		return (strlen($data)<$this->getFreeSpace() or $this->getFreeSpace()==0);
 	}
 
diff --git a/lib/filesystem.php b/lib/filesystem.php
index f242a1b158e5adfa03416a383307452a0bc5fb50..d7c485d25b8e0528c3275eb8b646a487cbe9a327 100644
--- a/lib/filesystem.php
+++ b/lib/filesystem.php
@@ -454,7 +454,7 @@ class OC_Filesystem{
 	 * @return mixed
 	 */
 	private static function basicOperation($operation,$path,$hooks=array(),$extraParam=null){
-		if(OC_FileProxy::runPreProxies($operation,$path) and self::canRead($path) and $storage=self::getStorage($path)){
+		if(OC_FileProxy::runPreProxies($operation,$path, $extraParam) and self::canRead($path) and $storage=self::getStorage($path)){
 			$interalPath=self::getInternalPath($path);
 			$run=true;
 			foreach($hooks as $hook){