Have a look in the Community Commons module in the Marketplace. In the Files folder, there is a Java Action called getFileSize that should do what you need.
Hope this helps.
If your Message entity inherits System.FileDocument, then you can use the FileDocument.HasContents boolean to find the document entities. If your Message entity has a relationship to another entity that inherits System.FileDocument, then you can either check the association for empty or for the associated object to have FileDocument.HasContents false. Typically, I check for the boolean over checking the association because the File widget commits the object more that you’d think.