Skip to content

fs_read_binary

fs_read_binary(filename) reads a binary file from the job’s directory. Returns nil if the file does not exist.

fs_read_binary(filename)
async
Param Type Description
filename string File name (relative to job directory)
Value Type Description
content string / nil Binary-safe file content, or nil if file does not exist
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" }
})