{"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. On-disk public caches clear within about 1 to 10 seconds after the update.","delete":"Needs a session with FILE DELETE or SUPER_ADMIN, and id. After an update or delete, on-disk public caches are cleared within about 1 to 10 seconds.","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."},"cache_delay":"After update or delete, public on-disk caches are removed within about 1 to 10 seconds. Until then a node may still serve the previous bytes.","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));"}