I am working on a frontend form witch gives users the ability to upload files. I almost managed to get FileAttachmentField working. It uploads the file to the desired folder but im not able to attache the uploaded file to it. The relation is a $has_one.
$fields->push(FileAttachmentField::create('BusinessLicense', 'Business License')
->setAcceptedFiles(['.pdf','.doc','.docx'])
->setFolderName($MemberID)
->setValue(null, $this)
The code above does not attach the file. If I change it to an UploadField like this:
$fields->push(UploadField::create('IdentityCard', 'Identity Card, Passport, Driving license')
->setFolderName($MemberID)
->setValue(null, $this)
);
it works. As far as I understood the docs I have to replace UploadField with FileAttachmentField. Can anyone please give me a hint. I tried hard to get this working. I don't see what I am doing wrong or what I am missing.