Welcome to the Hotfolder App! Your go-to solution for seamlessly managing image imports into Akeneo through scheduled tasks.
You can effortlessly pull images from external sources or drop your files into our drop zone, ensuring a smooth integration process. After import, we neatly organize the files, allowing you to track successes in the ‘done’ folder or identify any issues in the ‘failed’ folder (optional), complete with detailed explanations for failed imports. Simplify your workflow with the Hotfolder App and streamline your image management effortlessly.
To set up the Hotfolder App, ensure you have the following:
Import Strategy (Configuration):
Choose one of three methods:
Use a pattern within the filename or directory path (see Matching validators).
Utilize a Metadata file detailing the file path, product identifier, and attribute link.
Employ the dropzone to easily drop your images.
File Storage Resource Pool:
Establish a connection within the app to specify the location from which images should be pulled.
Currently, we support SFTP protocol and S3 object storage.
The hotfolder app has 3 tasks you can configure.
The pull_hotfolder task
The hotfolder_with_metdata_file task
The dropzone task
Click on tasks.
Create a task, a pull_hotfolder task and give it a proper name.
Click on edit
Edit your task, select your configured resource.
Click on save
Click on run
Once you clicked run, a manual operation will start the process. Afterwards, see the results in Akeneo.
To associate an attribute with a specific pattern, utilize matching_validators. These validators confirm matches based on the specified criteria.
The matching_validators directive is a crucial part of the app/settings.
{
"matching_validators": {
"main": {
"validator": "filename_validator",
"attribute": "images",
"match": "m",
"separator": "_"
}
}
}
Before delving into each validator, consider these best practices:
Prioritize strict validators like filename or directory to avoid false positives.
The order of operation matters; the first match takes precedence.
Choose a separator that doesn’t conflict with your filenames.
If pattern matching proves challenging, use a metadata file.
This common validator identifies matches within the filename.
<identifier><separator><match>.jpg
{
"matching_validators": {
"main": {
"validator": "filename_validator",
"attribute": "main_image",
"match": "main",
"separator": "__"
}
}
}
➡️ MATCH 1234__main.jpg
This validator identifies matches on directories within the incoming directory.
<match>/<identifier>.jpg
{
"matching_validators": {
"main": {
"validator": "directory_validator",
"attribute": "images",
"match": "main",
"separator": "__"
}
}
}
➡️ MATCH main/1234.jpg
➡️ MATCH main/1234__filename.jpg
Use regular expressions to match.
<identifier><separator><match>.jpg
{
"matching_validators": {
"main": {
"validator": "regex_validator",
"attribute": "images",
"match": "/^DC\\d{6}$/",
"separator": "__"
}
}
}
➡️ MATCH 1234__DC000134.jpg
Match based on the custom extension
<identifier><separator>.<match>
{
"matching_validators": {
"main": {
"validator": "extension_validator",
"attribute": "images",
"match": "LIBX",
"separator": "__"
}
}
}
➡️ MATCH 1234.LIBX
This type of validator does not just match the product(-model) identifier, this validator also maps the attribute. For example we have the filename TestPROD_123456_P011_NL_tech_sheet_ecommerce_20240105.pdf and we want to map the attribute technical-sheet to the filename, on all locales that start with nl.
Important to note is that currently only the mapping_validator supports the locale*.
The order in which the validator works is the following:
Go over all the mapping items and string replace them in the identifier. This results in the following:
TestPROD_123456_P011_nl*_technical-sheet_ecommerce_20240105.pdf
Then we explode the identifier on the separator, in this case _, and we get the following parts:
TestPROD
123456
P011
nl*
technical-sheet
ecommerce
20240105
Now we loop over the match array and we check if the part is a match.
none means we don’t care about this part
identifier means we want to store this part in the identifier
locale means we want to store this part in the locale
attribute means we want to store this part in the attribute
If duplicate parts are found, the parts are concatenated with a separator, in this case _
The result of this step is:
➡ identifier = 123456_P011
➡ locale = nl*
➡ attribute = technical-sheet
If one of the concatenated strings are included in the mapping, these parts are replaced with the mapped value.
The result of the match is stored on the product(-model).
"matching_validators": {
"primary_validator": {
"validator": "mapping_validator",
"mapping": {
"1": {
"part_of_string_in_filename": "attribute"
},
"2": {
"NL": "nl*"
}
},
"match": {
"1": "identifier",
"2": "attribute",
"3": "locale"
},
"separator": "-"
}
}
When dealing with localizable attributes, find a localizable pattern. By default:
"If the filename ends with a language like _en, store the file in all en locales. If the filename ends with a locale like nl_be, store the file in 1 locale nl_BE."
To customize locales, use the following mapping:
{
"locale_matcher": {
"FRBE": [
"fr_BE"
]
},
"locale_match_offset": 6
}
The dropzone offers a quick way to upload your images directly into Akeneo. Simply upload them to the dropzone, where you can define your matching pattern using either matching validators or a metadata file. Unlike other methods, the dropzone doesn’t require an external file resource for image uploads. It’s especially useful for temporary cases or initial loads.
Best practices
For large uploads, consider using a zip-file
The Metadata file is an option where the end user provides media-files along with a metadata file containing essential product and attribute-related information.
The metadata file can be in CSV or XLSX format.
Ensures a one-to-one link between the product and attribute by providing the necessary information in the file.
Certainly! Here are the examples proofread and simplified:
This example illustrates providing additional asset attribute information using specific attribute codes.
In this example, you can see how to include additional details like tags and localized labels (e.g., label-nl_BE) alongside product and attribute information.
The Hotfolder App allows you to process your images inside active directories. You can enable/disable those directories in the App/settings page.
By default, we use 3 active directories to process the files in.
incoming: the directory where you will upload your files (required)
done: the directory that will hold the processed files
failed: the directory that will hold the failed files, with log
# default
{
"active_directories": [
"incoming",
"failed",
"done"
]
}
# Done/Failed are optional so if you don't want any file residue after processing then set only incoming directory as **active**.
{
"active_directories": ["incoming"]
}