A good place to start is in the documentation: https://docs.moodle.org/dev/File_API and https://docs.moodle.org/dev/File_API_internals.
Courses and course formats
Where are "Server files\System" files stored
This discussion has been locked so you can no longer reply to it.