Were it me, I would simply use @Attachment functions to determine the names and sizes of the attachments, and, if over the limit, I’d pop up a prompt saying what the sizes were and what the limit is, and not let the user save.
I would not delete the attachment automatically, but would let the user make those choices.