(CRM-Backend) - Attach File to Contact?

Hello.

I’m trying to attach a file through the upload button on the site where the user can add a document and it would create a contact where the file attached on the button would appear on the " Attachment " field of contact.


Here is the code that is not working for it:

 let firstName = $w('#nameField').value;
 let email = $w('#emailField').value;
 let phone = $w('#phoneField').value;
 let attachment = $w('#upButton').value;
        wixCrm.createContact({
 "firstName": firstName,
 "emails": [email],
 "phones": [phone],
 "attachments": attachment // i tried [attachment] already
            })
            .then((contactId) => {
                console.log("Done");
            });

Can someone please help me. It is really important.

Thank you.

Where can i get help for this ?