Uploaded (non secure) attachments live now in public/

That way the attachment files can now be loaded much quicker (without invoking a controller). Also added thumbnailing for pictures in tables.
This commit is contained in:
Jan Böhmer 2019-10-05 20:30:27 +02:00
parent 1b28006267
commit 4fe10b6169
21 changed files with 552 additions and 21 deletions

View file

@ -75,7 +75,8 @@ class AttachmentHelper
}
/**
* Returns the absolute filepath of the attachment. Null is returned, if the attachment is externally saved.
* Returns the absolute filepath of the attachment. Null is returned, if the attachment is externally saved,
* or is not existing.
* @param Attachment $attachment The attachment for which the filepath should be determined
* @return string|null
*/
@ -95,7 +96,13 @@ class AttachmentHelper
if ($path === null) {
return null;
}
return realpath($path);
$tmp = realpath($path);
//If path is not existing realpath returns false.
if ($tmp === false) {
return null;
}
return $tmp;
}
/**