Size is standard attribute of filedocument since 7.4. The module is not updated (As should be done for all AppStore Modules per release IMHO ) . Update is easy
//attach.setSize(bodyPart.getSize());
Edit 1: Hi Mike
You can rename the size attribute to DocSize and adapt the java to .
attach.setSize(bodyPart.getDocSize());
Just place 'get' before the attribute name, which is the Java way to get the value. The 'set' you can guess....
In this case you will loose no data.
Have you checked that the userlib folder is clean? Updating modules does not remove old libs.
See: https://forum.mendix.com/link/questions/87690
Have you tried upgrading to a version between 6.10.9 and 7.6.0?