Files uploaded and used in Moodle are stored in Moodle's file system. The file system is the directory set up and configured as $CFG->dataroot
. Administratively, this should always be set up outside of the browsable web space in order to ensure that the files can only be accessed programmatically through Moodle's PHP scripts.
The Moodle data directory (often referred to as 'moodledata') is structured such that the root of the directory contains only subdirectories. Each of these subdirectories is responsible for holding data files for different purposes. We will look at several of the common areas found at the root of this directory.
You will notice a number of subdirectories that have numbers for names. These are the course file areas, and are named according to the data ID of the course that they belong to. There will be one directory for every course on your system.
Inside each of these numbered directories, there can be two system-created directories...