FILE::SENDFILE 1g 2025-09-11 laplante@plcb.ca GOWEB/FILE
title: “file::sendfile Function Documentation”
author: “laplante@plcb.ca”
date: “2025-09-11”
version: “1.0.1”
section: “1g”
category: “GOWEB/FILE”
Name
file::sendfile — Send a file to the client in HTTP or CLI mode.
Synopsis
file::sendFile or sendFile(file[error: variable, exit:bool, ct: string])
file::sendfile or sendfile(file[error: variable, exit:bool, ct: string])
Description
- In HTTP mode, this function sends a file back to the client.
- In CLI mode, it outputs the file to the client.
Parameters
- error : catch error if the file does not exist.
- ct : specify content type in HTTP mode. The default is automatic detection from the file.
- exit : if true, execution will stop after sending the file. Default is
true
.
Examples
res={{
sendfile("/tmp/ex.jpg");
}}.
Author
laplante@plcb.ca
See also
Version
- 1.0.1 — 2025-09-11 — camelCase (laplante@plcb.ca)
- 1.0.0 2024-04-07 laplante@plcb.ca initial version