Application Class not found error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deepsinghal29@gmail.com
    Junior Member
    • Jan 2024
    • 26

    Application Class not found error

    I am trying to extend an application class as follows to override the attachment path

    <?php

    namespace Espo\Custom\Core\FileStorage\Storages;

    use \Espo\Entities\Attachment;
    use \Espo\Core\Exceptions\Error;

    class EspoUploadDir extends Espo\Core\FileStorage\Storages\EspoUploadDir
    {
    protected function getFilePath(Attachment $attachment)
    {
    $sourceId = $attachment->getSourceId();
    return '/gcp/Attachments/' . $sourceId; // HERE YOUR CUSTOM PATH
    }
    }

    It seem it is not able to find the base class giving me below error -
    ERROR: Slim Application Error Type: Error Code: 0 Message: Class &quot;Espo\Custom\Core\FileStorage\Storages\Esp o\C ore\FileStorage\Storages\EspoUploadDir&quot; not found File: /var/www/html/crm/custom/Espo/Custom/Core/FileStorage/Storages/EspoUploadDir.php Line: 8 Trace
    ​​
  • item
    Active Community Member
    • Mar 2017
    • 1476

    #2
    use \Espo\Core\FileStorage\Storages\EspoUploadDir

    maybe
    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

    Comment

    Working...