{"path":"/files","session":"Send the session id as JSON field session or as cookie session.","actions":{"create":"Needs a session with FILE CREATE or SUPER_ADMIN. Send multipart field file, or JSON file_data as base64. Optional file_name, file_path, file_type, public_private (default PRIVATE). Returns ok, message, id.","update":"Needs a session with FILE UPDATE or SUPER_ADMIN, and id. Sent fields replace the old ones. New file bytes replace file_data.","delete":"Needs a session with FILE DELETE or SUPER_ADMIN, and id.","read":"Needs id. A PUBLIC file needs no session. A PRIVATE file needs a session with FILE READ, READ_PRIVATE, or SUPER_ADMIN. file_data comes back as base64; decode file_data from base64. The brand code is never returned; owner_id and owner_type only to a session on the file's brand.","search":"Needs a session with FILE READ. Filters are optional: file_name, file_type, file_size, date. With none, it lists your newest files (up to limit, default 100). file_name matches a name that contains the text. file_type is exact. file_size is the exact byte count. date is the created day, YYYY-MM-DD. order is ascend or descend, or asc or desc (default descend, newest first by created). limit is optional, 1 to 100. Returns metadata only. A person only gets files they uploaded on this session brand."},"created":"created is db2 server time; created_utc_offset in read and search answers gives its offset from UTC, e.g. -08:00.","file_types":["JPG","PNG","GIF","WEBP","SVG","HTML","CSS","JS","JSON","PDF","TXT","ICO","WOFF","WOFF2","MP4"],"public_private":["PUBLIC","PRIVATE"],"javascript":"const res = await fetch('/files/', { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ action: 'read', id: 'FILE_ID' }) }).then(r => r.json()); const bytes = Uint8Array.from(atob(res.file.file_data), c => c.charCodeAt(0));"}