fs_read_binary
fs_read_binary(filename) reads a binary file from the job’s directory. Returns nil if the file does not exist.
Signature
Section titled “Signature”fs_read_binary(filename)
asyncParameters
Section titled “Parameters”| Param | Type | Description |
|---|---|---|
filename |
string | File name (relative to job directory) |
Returns
Section titled “Returns”| Value | Type | Description |
|---|---|---|
| content | string / nil | Binary-safe file content, or nil if file does not exist |
Example
Section titled “Example”local png_data = fs_read_binary("screenshot.png")local resp = http_multipart("https://api.example.com/upload", { file = { content = png_data, filename = "page.png", type = "image/png" }})See Also
Section titled “See Also”- fs_read - Read text files
- http_multipart - Upload files via HTTP