This section covers the details of the BASE file system.
The DirectoryData
The FileData
userfiles
setting in
base.config
. The internalName
property is the name of the file on disk, but this is never exposed to
client applications. The filenames and directories
on the disk doesn't correspond to the the filenames and directories in
BASE.
The location
property can take three values:
0 = The file is offline, ie. there is no file on the disk
1 = The file is in primary storage, ie. it is located on the disk and can be used by BASE
2 = The file is in secondary storage, ie. it has been moved to some other place and can't be used by BASE immediately.
The action
property controls how a file is
moved between primary and seconday storage. It can have the following
values:
0 = Do nothing
1 = If the file is in secondary storage, move it back to the primary storage
2 = If the file is in primary storage, move it to the secondary storage
The actual moving between primary and secondary storage is done by an external program. See the section called “Secondary storage controller” and Section 26.6.2, “Secondary file storage plugins” for more information.
The md5
property can be used to check for file
corruption when it is moved between primary and secondary storage or
when a user re-uploads a file that has been offline.
BASE can store files in a compressed format. This is handled internally
and is not visible to client applications. The compressed
and diskSize
properties are used to store information
about this. A file may always be compressed if the users says so, but
BASE can also do this automatically if the file is uploaded
to a directory with the autoCompress
flag set
or if the file has MIME type with the autoCompress
flag set.
The FileTypeData
The MimeTypeData
File.mimeType
and File.fileType
properties. The MIME type is also
used to decide if a file should be stored in a compressed format or not.
The extension of a MIME type must be unique. Extensions should be registered
without a dot, ie html, not .html.