This simply resolves the id against the base directory.
Creates a subdirectory using the complete id, placing filename into it.
filename
Creates a subdirectory using the first two characters from the id. Below another subdirectory using the complete id and in there a file of filename.