Uploads path to the active base and returns the SeaTable file object
(a named list with name, size, type and url) ready to be written
into a file-typed cell via hb_update_rows() or hb_attach_file().
Arguments
- client
A
harbour_client.- path
Local file path. Must exist.
- ...
These dots are for future extensions and must be empty.
- relative_path
Folder under the base's asset root. The default,
"files", stands for the folder the upload link names:files/<YYYY-MM>for the current month, orimages/<YYYY-MM>whenpathhas an image extension (.png,.jpg,.jpeg,.gif,.bmp,.webpor.svg). Passing"files"yourself does the same. Any other value is used as given, but may not climb out of the asset root with...
Details
SeaTable's file endpoints authenticate with the base's API token, so
this needs a client created with api_token; a username/password
client gets a harbour_error_auth condition.
A finite client timeout bounds the complete upload request. A timeout can occur after the server has accepted the file; it does not establish that the upload was rolled back. Check the server before retrying to avoid creating a duplicate attachment. Uploads are not retried automatically.
See also
Other files:
hb_attach_file(),
hb_delete_asset(),
hb_download_file()
Examples
# needs a SeaTable server and an API token
if (FALSE) { # \dontrun{
client <- hb_client()
hb_upload_file(client, "report.pdf")
} # }