How can I access the file descriptors from a Mendix FileDocument object?

I need to upload a file from my Mendix App to an external system using Java. There for I need to get the file descriptor of the mendix file. Information I am looking for is phycial path of the file on the server and mimetype of the file. I don't see a way to get this information from the FileDocument object. Anyone who could help? Thanks Kind Regards Erno Rorive
2 answers

The real physical path of the File is abstracted in Mendix 5. You can only obtain an InputStream of the contents. It is described at the Moving from 4 to 5 section of the documentation here.


You can retrieve the filetype from the extension of the name. For example: If the name ends with .pdf it is an acrobat file. As an alternative you can use Apache Tika.

It is not recommended to use or know the physical path. Instead use

Core.getFileDocumentContent(context, fileDocument)

Using a webservice call is easier if allowed.