Show infos about filename and filesize on attachment edit tab.

This commit is contained in:
Jan Böhmer 2019-08-26 23:46:38 +02:00
parent 3a11933a89
commit 09a5948149
3 changed files with 45 additions and 2 deletions

View file

@ -100,6 +100,10 @@ class AttachmentHelper
*/
public function toAbsoluteFilePath(Attachment $attachment): ?string
{
if (empty($attachment->getPath())) {
return null;
}
if ($attachment->isExternal()) {
return null;
}
@ -119,6 +123,10 @@ class AttachmentHelper
*/
public function isFileExisting(Attachment $attachment): bool
{
if (empty($attachment->getPath())) {
return false;
}
return file_exists($this->toAbsoluteFilePath($attachment)) || $attachment->isExternal();
}