Did you read the
How To - https://docs.mendix.com/howto/data-models/working-with-images-and-files
Most of this stuff can be easily found by searching the documentation.