Where in the filesystem are attachments saved

I am trying to add an attachment straight to the database, and I read elsewhere on the forum that attachments are saved to the file system. Can someone please tell me where on the the filesystem they are saved.
1 answers

When you run your project locally, the files are saved in %PROJECT_DEPLOYMENT_DIR%/data/files. The directory is probably the same in the cloud.

There are however two problems:

1) You might not have write access to this directory, see: https://world.mendix.com/display/refguide3/Java+in+the+Cloud

2) I believe Mendix will not normally see the files you add in this directory, since there is no associated FileDocument object.

The solution to both these problems would be to write a Java action which uses Mendix functionality to create a FileDocument object, attach the file to the object and commit the object and the file.