What does BR-CL-24 mean?
An embedded attachment must state its file type as a valid MIME type (e.g. application/pdf) so the recipient can open it.
Common causes of BR-CL-24
- File extension ('pdf', 'jpg') entered instead of the full MIME type.
- A MIME type outside the six allowed values, e.g. 'application/xml' or 'image/gif'.
- The mimeCode attribute left out entirely although an attachment is embedded.
How to fix BR-CL-24
- Find the faulty spot in the XML. Open the XML of the invoice and go to field BT-125-1 along this XPath:
//ram:AdditionalReferencedDocument/ram:AttachmentBinaryObject/@mimeCode - Apply the fix. State the mime code of the embedded attachment (BT-125-1) in the mimeCode attribute. EN 16931 allows only these six values: 'application/pdf', 'image/png', 'image/jpeg', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' (xlsx), 'application/vnd.oasis.opendocument.spreadsheet' (ods). No file extension such as 'pdf'.
- Validate again. Save the file and validate it again to check that BR-CL-24 is no longer reported.
State the mime code of the embedded attachment (BT-125-1) in the mimeCode attribute. EN 16931 allows only these six values: 'application/pdf', 'image/png', 'image/jpeg', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' (xlsx), 'application/vnd.oasis.opendocument.spreadsheet' (ods). No file extension such as 'pdf'.
//ram:AdditionalReferencedDocument/ram:AttachmentBinaryObject/@mimeCodeBefore / after: the XML example
This is the spot in question before and after the fix (Cross Industry Invoice, ZUGFeRD/Factur-X).
<ram:AttachmentBinaryObject mimeCode="pdf" filename="anhang.pdf">JVBERi0=</ram:AttachmentBinaryObject>
<ram:AttachmentBinaryObject mimeCode="application/pdf" filename="anhang.pdf">JVBERi0=</ram:AttachmentBinaryObject>
Frequent questions about BR-CL-24
Which mime codes are allowed for attachments?
Is the file extension in the file name enough?
Related error codes
Check BR-CL-24 automatically
Instead of digging through the XML by hand you can validate your ZUGFeRD or XRechnung file online – upload the PDF or the XML and you get every error with rule ID, affected field, fix and XPath, as a readable report or as JSON through the API.