From e0a0570cc4409943d546ba114f5e9ba5e4aaa5d1 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 8 Nov 2018 11:06:44 +0100 Subject: $data only contains the link to the image if the image is in os storage. The size is calculatet wrong in this case and the download fails. rely on filesize from the db for content-length --- Zotlabs/Module/Photo.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Module/Photo.php') diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index 09c698b1a..de11b41c7 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -165,6 +165,7 @@ class Photo extends \Zotlabs\Web\Controller { if($exists && $allowed) { $data = dbunescbin($e[0]['content']); + $filesize = $e[0]['filesize']; $mimetype = $e[0]['mimetype']; $modified = strtotime($e[0]['edited']); if(intval($e[0]['os_storage'])) @@ -261,7 +262,7 @@ class Photo extends \Zotlabs\Web\Controller { } header("Last-Modified: " . gmdate("D, d M Y H:i:s", $modified) . " GMT"); - header("Content-Length: " . strlen($data)); + header("Content-Length: " . $filesize); // If it's a file resource, stream it. -- cgit v1.2.3