Attachment Class/Table

I was wondering how would I go about changing the Code for Attachments to Read Only. (What class I’ll be modifying)
In addition what table in the database would I be creating the trigger on?

image