EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
ref
Yuriied967a723153
diff --git a/application/Espo/Tools/Attachment/UploadUrlService.php b/application/Espo/Tools/Attachment/UploadUrlService.phpindex 43b4047ddf..ed67fe17b8 100644--- a/application/Espo/Tools/Attachment/UploadUrlService.php+++ b/application/Espo/Tools/Attachment/UploadUrlService.php@@ -81,16 +81,15 @@ class UploadUrlServicethrow new ErrorSilent("Bad image data.");}- $attachment->set([- 'name' => $url,- 'type' => $type,- 'contents' => $contents,- 'role' => Attachment::ROLE_ATTACHMENT,- ]);+ $attachment+ ->setName($url)+ ->setType($type)+ ->setContents($contents)+ ->setRole(Attachment::ROLE_ATTACHMENT)+ ->setTargetField($data->getField());$attachment->set('parentType', $data->getParentType());$attachment->set('relatedType', $data->getRelatedType());- $attachment->set('field', $data->getField());$size = mb_strlen($contents, '8bit');$maxSize = $this->detailsObtainer->getUploadMaxSize($attachment);