Appearance
Files
Cloud Flow Blocks reference.
Blocks
- Compress File
- Copy File
- Create Compressed File
- Create File
- Delete File(s)
- File Operation Data
- File Operation Error
- List Files
- Lookup File
- Read File
- URL of File (Public)
Compress File
Block name: file_compress
Compresses an existing file into a new destination file using Tinify options, then runs the nested success or error statements when the operation finishes.
Inputs
| Input | Type | Description | Accepts |
|---|---|---|---|
| path/name | string | The source file path and name. This is typically provided by a text block. | text |
| publicly accessible | boolean | Whether the source file path refers to the public area. This is typically provided by a logic_boolean block. | logic_boolean |
| new path/name | string | The destination file path and name for the compressed output. This is typically provided by a text block. | text |
| make publicly accessible | boolean | Whether the destination file should be stored in the public area. This is typically provided by a logic_boolean block. | logic_boolean |
| Tinify Key | string | The Tinify API key to use for compression. This is typically provided by a text block. | text |
| Resize options | object | Optional resize options object to pass to the compression operation. | |
| Convert options | object | Optional convert options object to pass to the compression operation. | |
| on success | statements | The statements to run when the compression operation succeeds. Inside this block, file_operation_response_data provides the operation response data. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. | |
| on error | statements | The statements to run when the compression operation fails. Inside this block, file_operation_response_error provides the operation error message. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. |
Output
This block does not produce an output value.
Behavior
Generates server-side code that compresses a source file into a destination file through the ioLoop file runtime using the provided Tinify key and optional resize/convert settings. The nested blocks are emitted inside function(tvwaFsResp) { ... }, so customcode and customcodeexpr blocks inside the success and error branches can access tvwaFsResp directly.
Calls: $io.fs.compressFile
Related Blocks
Copy File
Block name: file_copy
Copies an existing file into a new destination file, then runs the nested success or error statements when the operation finishes.
Inputs
| Input | Type | Description | Accepts |
|---|---|---|---|
| path/name | string | The source file path and name. This is typically provided by a text block. | text |
| publicly accessible | boolean | Whether the source file path refers to the public area. This is typically provided by a logic_boolean block. | logic_boolean |
| new path/name | string | The destination file path and name for the copied file. This is typically provided by a text block. | text |
| make publicly accessible | boolean | Whether the destination file should be stored in the public area. This is typically provided by a logic_boolean block. | logic_boolean |
| on success | statements | The statements to run when the copy operation succeeds. Inside this block, file_operation_response_data provides the operation response data. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. | |
| on error | statements | The statements to run when the copy operation fails. Inside this block, file_operation_response_error provides the operation error message. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. |
Output
This block does not produce an output value.
Behavior
Generates server-side code that copies a source file into a destination file through the ioLoop file runtime. The nested blocks are emitted inside function(tvwaFsResp) { ... }, so customcode and customcodeexpr blocks inside the success and error branches can access tvwaFsResp directly.
Calls: $io.fs.copyFile
Related Blocks
Create Compressed File
Block name: file_create_compress
Downloads a file from a URL, compresses it using Tinify options, creates a new file, then runs the nested success or error statements when the operation finishes.
Inputs
| Input | Type | Description | Accepts |
|---|---|---|---|
| URL | string | The source URL to download and compress. This is typically provided by a text block. | text |
| path/name | string | The destination file path and name. This is typically provided by a text block. | text |
| publicly accessible | boolean | Whether the created file should be stored in the public area. This is typically provided by a logic_boolean block. | logic_boolean |
| Tinify Key | string | The Tinify API key to use for compression. This is typically provided by a text block. | text |
| Resize options | object | Optional resize options object to pass to the compression operation. | |
| Convert options | object | Optional convert options object to pass to the compression operation. | |
| on success | statements | The statements to run when the compressed file is created successfully. Inside this block, file_operation_response_data provides the operation response data. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. | |
| on error | statements | The statements to run when the operation fails. Inside this block, file_operation_response_error provides the operation error message. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. |
Output
This block does not produce an output value.
Behavior
Generates server-side code that downloads a file from a URL and compresses it through the ioLoop file runtime using the provided Tinify key and optional resize/convert settings. The nested blocks are emitted inside function(tvwaFsResp) { ... }, so customcode and customcodeexpr blocks inside the success and error branches can access tvwaFsResp directly.
Calls: $io.fs.compressAndCreateFromUrl
Related Blocks
Create File
Block name: file_create
Creates a file from text or from a URL, then runs the nested success or error statements when the operation finishes.
Inputs
| Input | Type | Description | Accepts |
|---|---|---|---|
| source | choice | How the file contents should be created. | |
| source value | string | The text content to write, or the source URL to fetch from, depending on the selected source mode. This is typically provided by a text block. | text |
| path/name | string | The destination file path and name. This is typically provided by a text block. | text |
| publicly accessible | boolean | Whether the created file should be stored in the public area. This is typically provided by a logic_boolean block. | logic_boolean |
| on success | statements | The statements to run when the file is created successfully. Inside this block, file_operation_response_data provides the operation response data. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. | |
| on error | statements | The statements to run when the file creation fails. Inside this block, file_operation_response_error provides the operation error message. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. |
Output
This block does not produce an output value.
Behavior
Generates server-side code that creates a file either from text or from a URL through the ioLoop file runtime. The nested blocks are emitted inside function(tvwaFsResp) { ... }, so customcode and customcodeexpr blocks inside the success and error branches can access tvwaFsResp directly.
Calls: $io.fs.createFileFromText, $io.fs.createFileFromUrl
Related Blocks
Delete File(s)
Block name: file_delete
Deletes one or more files, then runs the nested success or error statements when the operation finishes.
Inputs
| Input | Type | Description | Accepts |
|---|---|---|---|
| name or list | array | The file path/name or list of file paths to delete. This is typically provided by a text block for a single file, but a list value can also be used. | |
| publicly accessible | boolean | Whether the file path refers to the public area. This is typically provided by a logic_boolean block. | logic_boolean |
| on success | statements | The statements to run when the delete operation succeeds. Inside this block, file_operation_response_data provides the operation response data. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. | |
| on error | statements | The statements to run when the delete operation fails. Inside this block, file_operation_response_error provides the operation error message. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. |
Output
This block does not produce an output value.
Behavior
Generates server-side code that normalizes the input into an array and deletes the selected files through the ioLoop file runtime. The nested blocks are emitted inside function(tvwaFsResp) { ... }, so customcode and customcodeexpr blocks inside the success and error branches can access tvwaFsResp directly.
Calls: $io.fs.deleteFiles
Related Blocks
File Operation Data
Block name: file_operation_response_data
Gets the response data for the current file operation callback.
Output
This block produces an output value of type String.
Behavior
Generates server-side code that reads the data field from the current file operation response object when one is available.
Related Blocks
file_createfile_deletefile_read_textfile_create_compressfile_listfile_lookupfile_compressfile_copyfile_operation_response_error
File Operation Error
Block name: file_operation_response_error
Gets the error message for the current file operation callback.
Output
This block produces an output value of type String.
Behavior
Generates server-side code that reads the err field from the current file operation response object when one is available.
Related Blocks
file_createfile_deletefile_read_textfile_create_compressfile_listfile_lookupfile_compressfile_copyfile_operation_response_data
List Files
Block name: file_list
Lists files whose path or name starts with the provided prefix, then runs the nested success or error statements when the operation finishes.
Inputs
| Input | Type | Description | Accepts |
|---|---|---|---|
| path/name starting with | string | The file path or prefix to list from. This is typically provided by a text block. | text |
| publicly accessible | boolean | Whether the path prefix refers to the public area. This is typically provided by a logic_boolean block. | logic_boolean |
| on success | statements | The statements to run when the list operation succeeds. Inside this block, file_operation_response_data provides the returned file list data. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. | |
| on error | statements | The statements to run when the list operation fails. Inside this block, file_operation_response_error provides the operation error message. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. |
Output
This block does not produce an output value.
Behavior
Generates server-side code that lists files through the ioLoop file runtime. The nested blocks are emitted inside function(tvwaFsResp) { ... }, so customcode and customcodeexpr blocks inside the success and error branches can access tvwaFsResp directly.
Calls: $io.fs.listFiles
Related Blocks
Lookup File
Block name: file_lookup
Looks up a file by path and name, then runs the nested success or error statements when the operation finishes.
Inputs
| Input | Type | Description | Accepts |
|---|---|---|---|
| path/name | string | The file path and name to look up. This is typically provided by a text block. | text |
| publicly accessible | boolean | Whether the file path refers to the public area. This is typically provided by a logic_boolean block. | logic_boolean |
| on success | statements | The statements to run when the file lookup succeeds. Inside this block, file_operation_response_data provides the returned file information. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. | |
| on error | statements | The statements to run when the file lookup fails. Inside this block, file_operation_response_error provides the operation error message. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. |
Output
This block does not produce an output value.
Behavior
Generates server-side code that looks up a file through the ioLoop file runtime. The nested blocks are emitted inside function(tvwaFsResp) { ... }, so customcode and customcodeexpr blocks inside the success and error branches can access tvwaFsResp directly.
Calls: $io.fs.lookupFile
Related Blocks
Read File
Block name: file_read_text
Reads a file as text, then runs the nested success or error statements when the operation finishes.
Inputs
| Input | Type | Description | Accepts |
|---|---|---|---|
| path/name | string | The file path and name to read. This is typically provided by a text block. | text |
| publicly accessible | boolean | Whether the file path refers to the public area. This is typically provided by a logic_boolean block. | logic_boolean |
| on success | statements | The statements to run when the file is read successfully. Inside this block, file_operation_response_data provides the returned file text. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. | |
| on error | statements | The statements to run when the read operation fails. Inside this block, file_operation_response_error provides the operation error message. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. |
Output
This block does not produce an output value.
Behavior
Generates server-side code that reads a file as text through the ioLoop file runtime. The nested blocks are emitted inside function(tvwaFsResp) { ... }, so customcode and customcodeexpr blocks inside the success and error branches can access tvwaFsResp directly.
Calls: $io.fs.readFileAsText
Related Blocks
URL of File (Public)
Block name: file_public_url
Gets the public download URL for a file path in the public area.
Inputs
| Input | Type | Description | Accepts |
|---|---|---|---|
| path/name | string | The public file path and name. This is typically provided by a text block. | text |
Output
This block produces an output value of type String.
Behavior
Generates server-side code that builds the public download URL for a file path through the ioLoop file runtime.
Calls: $io.fs.getPublicFileDownloadUrl

