Forums | Mahara Community
what folder the files are upload by users?
16 December 2010, 10:43
can you tell me in what folder the files are upload by users?
16 December 2010, 11:26
This will depend upon your installation. When you set up mahara, you will have created a config.php. Uploaded data is stored in the uploaddir subdirectory of $cfg->dataroot
Most files are stored in the artefact/file directory within the uploaddir.
16 December 2010, 14:39
In the folder Artifact/file of my dataroot, exists file is no extension, those files that are within this folders net are the files uploaded by users?
21 December 2010, 9:36
Uploaded files do not have their original names in Mahara, they are stored in "hashed" directory structure for better perfomance on large scale sites. On the uploading, the file is renamed to the ID of its corresponding artefact and put in the sub-directory within artefact/file/originals/. The name of the sub-directory is the recidual of <artefact_id> divided by 256. So the full path to the file is:
<$cfg->dataroot>/artefact/file/originals/<artefact_id> % 256/<artefact_id>
21 December 2010, 15:54
Thanks for the explanation, I now understand better how work Mahara
19 January 2013, 5:24
It seems a slightly odd way of distributing files into directories - but has it's own internal logic. Unfortunately I've been trying to apply the structure to how files appear in my own maharadata folder and it isn't making any sense. I've been having problems with indexes in the database and wonder if the issue is that my maharadata folders have been messed up - or if the content is in the right place and I've just misunderstood the filepath that you outlined.
e.g. In folder originals/255 I've got files that include numbers 2047, 11007 & 24063 - dividing those numbers by 256 suggests they should all be in completely different folders. Can anyone offer some insight that would explain how these files end up together?