Binary Store
The Binary Store component allows you to store binaries in the Content Store.
The component will take a stream reference in the binary
key of the incoming object and use it to store the binary into a Mongo database.
It's also possible to use a file path reference in the filePath
key when the binary stream is not available in the object.
Configuration
Connection string
A MongoDB connection string.
Example: mongodb://<username>:<password>@localhost:27017/<databaseName>
Here <databaseName>
is the database to store the binary.
Use TLS
Enables TLS for your mongoDB connection.
Allow Invalid Certificates
Checking this will disable certificate validation. Warning: specifying this option in a production environment makes your application insecure and potentially vulnerable to expired certificates and to foreign processes posing as valid client instances.
Certificate Authority File
One or more certificate authorities to trust when making a TLS connection. In order to access the local filesystem, the XILL4_WORKDIR
environment variable must be set to the path of the directory to be accessed.
Example: .\ca.pem
Inputs
-
Name: Input
-
Description: The component will look on the incoming message for the
binary
key. If there is nobinary
key, the component will look forfilePath
key. At least one of the two is required.The binary key must contain a stream reference. The filePath key must contain a path to the file on the local system. In order to access the local filesystem, the
XILL4_WORKDIRS
environment variable must be set to the path of the directory to be accessed.When using the binary key, an
_id
field must be specified in the incoming message. This will be used as the_id
and the filename in the Content Store. When usingfilePath
, the_id
and filename will be generated by hashing the file path (using SHA512) or you can specify the_id
field in the incoming message to override the generated_id
. -
Example: Using a stream
{
"_id": "6232dea643dbbf33e0906e85",
"binary": // containing a readable stream,
} -
Example: Using a file from the local file system:
{
"filePath":"C://Users/xillio/Downloads/test-file.json"
}
-
Outputs
-
Name: Output
-
Description: The output contains the
value
key which refers to the incoming message and theresult
key which contains thelocalReference
, referencing the stored binary_id
field in the Content Store. -
Example:
{
"value": {
"filePath":"C://Users/xillio/Downloads/test-file.json"
},
"result": {
"localReference": "6232dea643dbbf33e0906e85"
}
} -