Working with files in Moodle can be a little confusing if you do not understand the File API. Internal Files are stored in a combination of a physical nondescript file on disk and a table record. This YouTube presentation will covers the API.
This video has UK English subtitles and if you struggle with English or even with my accent, you can use YouTube’s auto-translate functionality to view the subtitles in your preferred language.
This video is an extract from the ‘Moodle Plugins By Example’ course – go to the Course Page for more details.