I'm working on a file upload of an image with a registration form. The file is being passed to PHP correctly, and I can check its properties in the $_FILES variable. I used the API Explorer to get the code example below. This question (Uploading files through the API) touches on this, but the answer just directs the person to the API Explorer.
$result['attachment'] = civicrm_api3('Attachment', 'create', [
'name' => $name,
'mime_type' => $_FILES['image']['type'],
'entity_id' => $result['contact']['id'],
'field_name' => 'custom_3',
'content' => $_FILES['image'],
The error I receive is:
Mandatory key(s) missing from params array: 'id' or 'content' or 'options.move-file'
but I have no idea what this means.
content is set in the params. This API call happens after a working sequence of creating a Contact, Address, Email, Websites, and more for the signup. I can find no other guidance on completing this.