Connect to MI
Specify a database and table.Create a new record
Define a path in the table from a starting folder (in this case the top level folder) usingpath_from().
If the path does not exist, the required folders will be created.
Specify end_node to create a new Record object at the end of the path with that name.
Add files to the record
To add a file to a file attribute (or a picture to a picture attribute) there are two approaches. Create a File or Picture object, and set thebinary_data property directly with either a file buffer or
bytes object. (Useful when you have a file already loaded in your script.)
Add hyperlinks to the record
To add a hyperlink to a hyperlink attribute, set thevalue property. Optionally, you can also set the hyperlink_display
and/or hyperlink_description properties.
include_binary_data_in_refresh = True means that
the picture data will be included in the resulting Record object, rather than a URL reference to the picture data.
Save files attached to a record
Verify your changes by first extracting the new image from the record, then saving it to disk. You can either access thevalue directly or provide a file path to the save() method.
First, ensure the output directory exists. This directory will already exist if a notebook
was run previously that saved a file to disk.
