Expand description
Local file uploads: a signed URL, a temporary directory, and the calls the browser makes.
See docs/uploads.md for the contract this implements.
Functions§
- filename_
is_ safe - Whether a name the browser sent can name a file in the temporary directory.
- finish_
upload - Handles
_finishUpload, which writes the temporary names into the component’s field. - is_
upload_ call - Whether a call is one of the upload calls, which the dispatcher handles before any action.
- max_
bytes - The largest file the configured rules allow, in bytes, when they declare
max:<kilobytes>. - preview
- The preview endpoint: serves a temporary file whose kind may be previewed.
- prune
- Deletes the temporary uploads older than
age, and reports how many it deleted. - remove_
upload - Handles
_removeUpload, which deletes a temporary file and tells the browser. - signature_
is_ valid - Whether an upload URL was made for
idand has not expired. - signed_
url - The upload URL for
id, valid for the configured window. - start_
upload - Handles
_startUpload, which answers with the URL the browser posts to. - store
- The upload endpoint: stores the files a signed URL was made for.
- store_
with - Stores the files for
config, which the route and the tests both use. - temporary_
directory - The directory the temporary uploads live in, relative to the application’s private disk.
- temporary_
name - A temporary file name that cannot leave the directory.
- temporary_
path - Where that directory is on this host, which is how a file is deleted and how a preview is read.
- trim
- Deletes what an abandoned upload left, then the oldest files until the directory fits
max_bytes. - upload_
errored - Handles
_uploadErrored, which tells the browser the upload failed.