Standard way for Mendix is to save the files in a folder on the server (on a local system it is in your deployment\database\files folder). The reference to the file is saved in the database. Opening a file directly from the file system is hard, because from the name (random string without extension) you cannot know what type of file it is.
You can take a look at the microsoft graph connector on the marketplace. This allows you to store files on a dedicated SharePoint drive where you can allow/restrict access as well.