mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-06 08:24:35 +02:00
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:
parent
1b28006267
commit
4fe10b6169
21 changed files with 552 additions and 21 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue