To store a document in Mendix you can do the following: go to your Domain model and instead of using the Document attribute in your Entity, you can create another entity that will be used to stored the Document. This new entity needs to be a Generalization of FileDocument (from System module) like so:
You can learn about the process of creating a new Entity with the capability to store a File Document here.
And here is an example of how your domain model could look like with said changes (this may vary for, because in this type of association that I posted states that a Person can have many Documents, you may want to change that depending on how you want your logic):
If you have any more questions please mention them and we’ll gladly help, regards!