When creating an Attachment in Salesforce, the body of the Attachment is a required field.
Therefore, if you get this error, it means that no file was uploaded on the form.
Full error message:
The record could not be created in the Attachment object. Reason: There was nothing attached to the body of the Attachment object.
1. Make the File upload field on the form required (of course, if it’s mandatory for the submission) – this won’t allow the user to submit the form if there is no file uploaded.
2. Send data to Salesforce only when the File upload field is not empty. Go to Object Mapping – Attachment and for Record preferences, under Send data if select your upload field and choose to create the record if this field is not empty.