You can also use the community commons package, action Misc > getFileSize
Easily done with a small java action
Double size = 0.0;
if (__FileObj != null) {
File f = Core.getFileDocumentContentAsFile(getContext(), __FileObj);
size = (double) f.length() / 1024;
}
return size;