Silverstripe Dropzone:文件附件字段保存文件但不附加它

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.

When saving into a $has_one relation you often need the ID suffix though some fields have some custom magic and work without it.

So something like

$fields->push(FileAttachmentField::create('BusinessLicenseID', 'Business License')

should work