Read a File from a Shared Folder

Estimated reading time: 1 minute

OT Link Platform Flows can utilize Network Storage to read data directly from a shared folder on the network. This allows OT Link Platform to access file contents from Windows, Mac, and Linux machines that are connected to the same network.

Add a Flow to Read from Network Storage

The following flow will read data from a file in a shared folder on a Windows 10 machine.

To add a flow that will read from a file in a network shared folder:

  1. Connect an Inject node, a Function node, a File in node, and a Debug node.

  2. Double-click the Function node. Enter the following lines:

    msg.filename = "/data/<mount point name>/<filename in shared folder>";
    return msg;
    
  3. Click Done. Click Save.
  4. Click the inject node button to read the full contents of the file. You can view the file contents in the Debug tab.

    You may find that files read from Windows machines will output the file contents onto a single line. This is because the newline character is different on Windows machines, and OT Link Platform flows uses the Unix newline character. To have newlines from Windows files output correctly in Flows, you must use Unix newline characters.