Skip to content
Snippets Groups Projects
Verified Commit d3c2f080 authored by Damien's avatar Damien
Browse files

FEAT #10702 TIME 0:30 Attachments Thumbnail

parent 7f722680
No related branches found
No related tags found
No related merge requests found
......@@ -140,14 +140,14 @@ class AttachmentController
'data' => [$args['id'], 'TNL' . $args['page']]
]);
$docserver = DocserverModel::getByType(['type' => 'DOC', 'select' => ['path']]);
$docserver = DocserverModel::getByType(['type' => 'ATTACH', 'select' => ['path']]);
if (empty($docserver['path']) || !file_exists($docserver['path'])) {
['errors' => 'Docserver does not exist'];
return $response->withStatus(400)->withJson(['errors' => 'Docserver does not exist']);
}
$pathToThumbnail = $docserver['path'] . $adr[0]['path'] . $adr[0]['filename'];
if (!is_file($pathToThumbnail) || !is_readable($pathToThumbnail)) {
return ['errors' => 'Document not found on docserver or not readable'];
return $response->withStatus(400)->withJson(['errors' => 'Attachment not found on docserver or not readable']);
}
$fileContent = file_get_contents($pathToThumbnail);
......
......@@ -497,12 +497,12 @@ class DocumentController
$docserver = DocserverModel::getByType(['type' => 'DOC', 'select' => ['path']]);
if (empty($docserver['path']) || !file_exists($docserver['path'])) {
['errors' => 'Docserver does not exist'];
return $response->withStatus(400)->withJson(['errors' => 'Docserver does not exist']);
}
$pathToThumbnail = $docserver['path'] . $adr[0]['path'] . $adr[0]['filename'];
if (!is_file($pathToThumbnail) || !is_readable($pathToThumbnail)) {
return ['errors' => 'Document not found on docserver or not readable'];
return $response->withStatus(400)->withJson(['errors' => 'Document not found on docserver or not readable']);
}
$fileContent = file_get_contents($pathToThumbnail);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment