From ffa86dfea8aef25af8bff9a5ff6342f5b6e7a7c3 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 10 Jan 2014 13:10:50 -0800 Subject: this may fix filesize 0 issues --- include/reddav.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/reddav.php') diff --git a/include/reddav.php b/include/reddav.php index 69fcf8bec..a962d1bcc 100644 --- a/include/reddav.php +++ b/include/reddav.php @@ -321,15 +321,15 @@ class RedFile extends DAV\Node implements DAV\IFile { function put($data) { logger('RedFile::put: ' . basename($this->name), LOGGER_DEBUG); - $r = q("select flags, data from attach where hash = '%s' and uid = %d limit 1", dbesc($hash), intval($c[0]['channel_id']) ); if($r) { if($r[0]['flags'] & ATTACH_FLAG_OS) { - @file_put_contents($r[0]['data'], $data); - $size = @filesize($r[0]['data']); + $f = 'store/' . $this->auth->owner_nick . '/' . (($r[0]['data']) ? $r[0]['data'] . '/' : ''); + @file_put_contents($f, $data); + $size = @filesize($f); } else { $r = q("update attach set data = '%s' where hash = '%s' and uid = %d limit 1", -- cgit v1.2.3