support attachments with Base64-encoded data in the Content attribute of the instance of File class
This commit is contained in:
parent
153783f7ce
commit
8cd25ef90e
@ -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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user