Files: what a task can carry
A task can carry files as well as links (board #2436): drop one on a task
on the board, or virta attach #n ./shot.png from a shell. The bytes go to
the host's private virta:files storage area (service-compris 0.3.0) and
the task gets an attached event naming them. Readers fetch a file with
their own credential, through /blob; nobody else can read it.
- What: images, video, audio, PDF, markdown and plain text, up to 25 MB each. Anything else is refused before it's sent.
- Where: a file's path is its content hash (
<sha256>.<ext>), so the same bytes are one file however many tasks carry them. - Links stay links: a URL is attached as a link, never copied.
import { contentTypeFor, fileRefusal, filePathFor } from 'tosijs-virta'
contentTypeFor('shot.png') // 'image/png'
fileRefusal('notes.exe', 1024) // why it can't be attached
filePathFor('ab12…', 'shot.png') // 'ab12….png'