der Anhang
attachment
A document, file, or other part that is attached to an email, letter, or another written document.
Im Anhang finden Sie meinen Lebenslauf und meine Zeugnisse.
Please find my résumé and certificates in the attachment.

attachment / appendix / entourage
Loading your saved state.
attachment
A document, file, or other part that is attached to an email, letter, or another written document.
Im Anhang finden Sie meinen Lebenslauf und meine Zeugnisse.
Please find my résumé and certificates in the attachment.

The word is derived from the verb 'anhängen' (to attach). An 'Anhang' (attachment / appendix / entourage) is therefore literally something that is 'angehängt' (attached) to something else. This logic applies to email attachments, appendices in books, and also groups of people.
Bitte hängen Sie die Dokumente als PDF an.
Please attach the documents as a PDF.
The context reveals the meaning. If it is about emails or letters, it refers to a file. In books or reports, it is the final section. If people are being discussed, it means their entourage or following.
Die Datei ist zu groß für den Anhang.
The file is too large for the attachment.
When referring to an email attachment or a book appendix, the preposition 'in' with the dative is almost always used to describe where the information is located: 'im Anhang' (in the attachment / in the appendix).
Im Anhang dieser E-Mail befindet sich das Protokoll der Sitzung.
The minutes of the meeting are in the attachment to this email.
When 'Anhang' (entourage) is used for a group of people, it can have a slightly negative or ironic undertone. It implies that the people are not independent and merely follow along.
Der Chef kam mit seinem gesamten Anhang zur Firmenfeier.
The boss came to the company party with his entire entourage.
facility / attachment / investment
'die Anlage' and 'der Anhang' can both mean a file or document that belongs with an email or letter. 'Anhang' is especially common with emails and means the attached file. 'Anlage' sounds somewhat more formal and is often used in letters, applications, or official correspondence. Learners may confuse the words because both refer to attached documents. In a normal email, people usually say 'Anhang'; in formal writing, 'Anlage' is very appropriate.

Im Anhang der E-Mail ist das Formular für die Anmeldung.
The registration form is in the email attachment.
Die Rechnung finden Sie in der Anlage zu diesem Schreiben.
You will find the invoice in the attachment to this letter.