Download Controller File To Device (LCC.web_file.download_file)
Signature
ok, err = LCC.web_file.download_file(path, target_path, timeout?)
Parameters
- path
String. Source path on the controller. - target_path
String. Absolute destination path on the device. - timeout
Number, optional. Request timeout in seconds, default60.
Returns
- ok
Boolean.truewhen the download succeeds,falseotherwise. - err
String ornil. Error description when the operation fails.
Notes
Downloads a file from the controller and saves it to the device.
Returnsfalseif the target directory is missing or the write fails.
Example
local ok, err = LCC.web_file.download_file("/scripts/main.lua", XXT_SCRIPTS_PATH.."/cache.lua")
if not ok then
error(err)
end