FileDocument objects are stored in the Mendix database, so you can use the ‘getGUID” java action from the CommunityCommons module, just like any other object. When you retrieve a filedocument object, it's binary contents are automatically retrieved from the file storage.
The GUID of a file document is stored in an internal data field. This field can be used to locate the files on disk. It can be accessed as follows:
String guid = (String) fileDocument
.getMember(getContext(), "__UUID__")
.getValue(getContext());
or
String guid = (String) fileDocument.getValue(getContext(), "__UUID__");