Document and File Type Handling
The Catenis system is extremely flexible and can handle logging and sending (messaging) content and data of any size and/or type. Catenis was designed with powerful information/content-agnostic capabilities so it can be used by a myriad of applications across an endless number of industries.
A common use case of blockchain technology is to log or send files with their respective mime types (document-name and document- extension) such as word documents, PDF documents, mp4 movies, or mp3 music. These files can only be opened by their respective client applications and computers use file extensions to help identify file types.
Catenis, on the other hand, accepts and transmits everything via a byte stream which makes it extremely powerful. Catenis does not have any notion of a file type nor the files extension. When handling documents or files we need to build a trivial protocol to pass to Catenis the content of the file along with the name and it’s extension as one byte stream in a specific encoding type (base64 is typically used for files). The following graphic depicts this process:
When receiving the payload from Catenis we need to run through the same protocol and extract the filename and extension from the payload and reassemble it as a file then save it. The following graphic depicts this process:
A Working Catenis Flow File Handling Implementation
To make this implementation easier we have prewritten a flow and a helper module called the Catenis-file module. Installing and configuring both the example flow and the module will provide you an example that you can further extend. All you need to do is follow the instructions that can be found here: https://flows.nodered.org/flow/c2ba3a3bf0c8585afc8ce4e546efbf94