Simple File System Store¶
Simple File System Store is the default file store type. It uses a file system (local or a mounted share) to store files. If Simple File System Store is used in a clustered environment, its the folder must be accessible to all cluster nodes, handle concurrent requests, and support file locking. We recommend using a Storage Area Network or a clustered file system.
The simple file system store is bound to the Liferay DXP database. The default root folder is
[Liferay Home]/data/document_library. The Simple File System Store saves files using this file path format:
Here’s an explanation of the file hierarchy in the
[Liferay Home]/data/document_library folder:
companyId: The site’s company ID.
folderId: The ID of the app’s folder (e.g., Documents and Media folder) containing the file entry.
numericFileEntryName: The file entry’s numeric name.
versionNumber: The file entry’s version number.
Note: A document’s numeric file entry name and document ID differ in these ways:
They have independent counters.
The numeric file entry name is used in the storage file path but the document ID is not.
They’re stored in different
DLFileEntrytable columns. The numeric file entry name is stored in the
namecolumn and the document ID is stored in the
If a database transaction rollback occurs in a Document Library, the transaction’s file system changes are not reversed. Inconsistencies between Document Library files and those in the file system store can occur and may require manual synchronization. All of the DXP stores except DBStore are vulnerable to this limitation.
Configuring the Store¶
Follow these steps to configure your Simple File System store:
Click the Menu () button to access the Control Panel.
Navigate to Control Panel → Configuration → System Settings.
In the Platform section, click File Storage.
In the Simple File System Store screen, set the Root directory to your Liferay Home path (absolute or relative).
The file store switches immediately to the new folder.
If you switch from a another store type to Simple File System Store, configure
portal-ext.properties with the following property and restart DXP.
Using the Store in a Clustered Environment¶
In a clustered environment, point the store to a network mounted file system that all the nodes can access. The networked file system must be accessible to all nodes, support concurrent requests, and support file locking. If Simple File System Store is used without such a file system and multiple users attempt writing to the same file concurrently, data corruption can occur.