diff --git a/mocha-php/src/mocha-php/ui/pages/AttachmentPage.phpx.php b/mocha-php/src/mocha-php/ui/pages/AttachmentPage.phpx.php index bf39a8f..4159ef6 100644 --- a/mocha-php/src/mocha-php/ui/pages/AttachmentPage.phpx.php +++ b/mocha-php/src/mocha-php/ui/pages/AttachmentPage.phpx.php @@ -49,10 +49,19 @@ { $ext = "svg"; } + $content = $oms->getAttributeValue($inst, KnownAttributeGuids::Value); $path = "/var/mocha/uploads/" . $inst->GlobalIdentifier->__toStringFormat(false, null, null) . "." . $ext; //echo ("iid: " . $inst->GlobalIdentifier); - if (file_exists($path)) + if ($content != null) + { + $contentBytes = base64_decode($content); + header("HTTP/1.1 200 OK"); + header("Content-Type: " . $contentType); + header("Content-Length: " . strlen($contentBytes)); + echo ($contentBytes); + } + else if (file_exists($path)) { $fsz = filesize($path);