How do I import assets automatically from the filesystem?
Asset Bank supports the concept of 'watched directories', where you can specify one or more locations on the filesystem from which asset files will be automatically inserted. This is enabled by setting configuration option watch-directory-auto-add=true. (Note, if this is set to false the directories will still be watched, but the presence of new files will just result in an alert email being sent to admin users.)
Adding a Watch Directory
First, make sure that application setting watch-directory-count is set for the number of watched directories you require. By default this is set to 1.
The second step is to enter the directories in settings watch-directory, watch-directory2, watch-directory3 etc. depending on how many you need. The directory path should start with a slash. For example, to set up the second watch directory called 'images' in the root of the server, the setting would be: watch-directory2=/images
If you have asset types enabled (asset-entities-enabled=true) then you need to use at least version 3.980 of Asset Bank and set the asset type for each directory with watch-directory-asset-entity-id, watch-directory-asset-entity-id2, watch-directory-asset-entity-id3 etc.
You can tell Asset Bank how often it should check for new files using application setting watch-directory-period-millis which takes a value in milliseconds. For example, to get Asset Bank to scan the watched directories every hour, set this setting to 3600000.
Assigning Access Levels
When assets are added using this method, you may not want them to be accessible straight away, and/or may want to group them so that they are easy to find. You can do this by specifying one or more Access Levels to be automatically assigned to assets loaded from each watched directory. This is done with settings watch-directory-access-levels, watch-directory-access-levels2, watch-directory-access-levels3, etc. where the value for each is a comma-separated list of Access Level ids (e.g. watch-directory-access-levels2=1,8,9).
Mapping Directories to Categories
The directory structure within the watch directory can be mapped to the category structure in Asset Bank. Assets placed in subdirectories can automatically be assigned to the corresponding category and the category will be created if necessary. This functionality can be enabled by setting map-watch-subdirectories-to-categories=true. Alternatively, this can be used to instead map the directory structure to access levels. To enable this please set map-watch-subdirectories-to-access-levels=true. Note: These settings cannot both be set to true.