/tmp
directory which are subject to deletion between executions, File Stores are separate cloud storage. Files within a File Store can be long term storage accessible by your workflows.
$.files
helper within Node.js code steps.
$.files.dir()
method allows you to list files and directories within the Project’s File Store. By default it will list the files at the root directory.
Here’s an example of how to iterate over the files in the root directory and open them as File
instances:
example.png
, you can open it using the $.files.open()
method:
/tmp
directory in your workflows or directly from streams for high memory efficency.
File.fromUrl()
can upload a file from a public URL to the File Store.
First open a new file at a specific path in the File Store, and then pass a URL to the fromUrl
method on that new file:
/tmp
directoryFile.fromFile()
can upload a file stored within the workflow’s /tmp
directory to the File Store.
First open a new file at a specific path in the File Store, and then pass a URL to the fromFile
method on that new file:
File.createWriteStream()
creates a write stream for the file to upload to. Then you can pair this stream with a download stream from another remote location:
ReadableStream
instance directly to a File instance:
contentLength
argument, then File Store will be able to efficiently stream to use less memory. Without a contentLength
argument, the entire file will need to be downloaded to /tmp/
until it can be uploaded to the File store./tmp
directorytoFile()
method to download the file to the given path:
/tmp/
directory is readable and writableMake sure that your path to toFile(path)
includesFile
instance directly.
For example, if you have a file stored at the path logo.png
within your File Store, then within a Node.js code step you can open it:
steps
path:
$.flow.suspend()
and $.flow.delay()
.File
instances:
$.files.openDescriptor
to parse the JSON definition of the files back into File
instances:
delete()
on the file to delete it from the File Store.