I believe the current pluggable widgets API allows only for read only access to files. However, it can be done. Perhaps this widget can give you some ideas or is maybe even what you’re looking for:
https://marketplace.mendix.com/link/component/111497
Source on GitHub: