mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-06 08:24:35 +02:00
Show infos about filename and filesize on attachment edit tab.
This commit is contained in:
parent
3a11933a89
commit
09a5948149
3 changed files with 45 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue