File
class resources.file.File
Base class: Resource
A file which is stored in Cloudomation.
To store data in a file there are three additional arguments for the save()
method available:
:py:obj:flow_api.file.File
import flow_apidef handler(system: flow_api.System, this: flow_api.Execution):# store a text (utf8 string)system.file('my-file.txt').save_text_content('text content')# read as base64assert system.file('my-file.txt').get_base64_content() == 'dGV4dCBjb250ZW50'# store bytes datasystem.file('my-file.dat').save_bytes_content(b'bytes data')# read as textassert system.file('my-file.dat').get_text_content() == 'bytes data'# store a base64 encoded stringsystem.file('my-file.ext').save_base64_content('Q2xvdWRvbWF0aW9u')# read as bytessystem.file('my-file.ext').get_bytes_content() == b'Cloudomation'
Property | Description | Type |
---|---|---|
id | UUID() | |
content | The binary content of the file. | BYTEA() |
size_bytes | BigInteger() |