File upload to SFTP

Hello everyone, What is the best way to store files on my server? I currently have the following structure - Entity (let's call it Person), which has First and Last Name and a file (document). 1 person has 1 document and 1 document has 1 person. I want to store the files to each person on their own server. From what I've read so far - I downloaded the SFTP connectivity module (LINK), then picked up SFTP Server and successfully connected to it using the module in question. As a good practice, I figured out that I should set up Microflow, which on Commit Event uploads the file to the server and deletes it from the Mendix database. Anyway, I still have some ambiguities about how I should structure my files in the SFTP in question, how I should download them on demand (I was thinking options about writing a unique identifier for each uploaded file in Person and on download request accessing them using this identifier). As the files in question are extremely sensitive information (personal data) it is a critical requirement for me that they are stored on my server, and we are only talking about the files - the database itself will remain in mendix. I'd be happy if someone shared best practices as well as whether I'm on the right track!
1 answers


If I were doing this, I would use the file handling capabilities built into the platform.  To do this, you will create an entity that is a specialization of system.filedoc and then use the file widgets on a page to enable upload of documents.  You can find an introduction to these capabilties here:  Hope that heops you get started.