Skip to main content
GET
Requires version 2.0.0 or later of the Archetype platform.

Overview

This endpoint streams the raw contents of a file, looked up by the file’s file_uid (a value starting with fil_) instead of by its filename. It otherwise behaves like Download File. The response carries Content-Type set to the stored file type, Content-Length, and a Content-Disposition: attachment header with the file’s name. Only files whose status is FILE_STATUS_REGISTERED or FILE_STATUS_INGESTED can be downloaded. A file that is still uploading or is corrupt returns an HTTP 409 error with the code file_not_available. Files you can’t see, files that are being deleted or are already deleted, and values that aren’t a file_uid return an HTTP 404 error.

Path Parameters

string
required
The file’s file_uid (fil_...), as returned by the upload endpoints and in every file metadata record.

Header Parameters

string
A single byte range to download, as bytes=first-last (both inclusive; a last past the end of the file stops at the end), bytes=first- (to the end of the file) or bytes=-n (the last n bytes). A Range header with several ranges, a unit other than bytes, or a malformed value is ignored, and the whole file is returned with 200.
string
Serve Range only if the file’s ETag is still exactly this value. Otherwise the range is ignored and the whole current file is returned with 200. Dates and weak tags never match.
string
Download only if the file’s ETag is one of these comma-separated values, or this is *. Otherwise the response is 412 with the code precondition_failed and carries no file content. If-Match is checked before Range, so a failed If-Match returns 412 even when the range can’t be satisfied.

Response

The response body is the raw file bytes. A satisfiable Range is answered with 206 and only the requested bytes, plus a Content-Range: bytes first-last/size header. A range that starts at or past the end of the file, or bytes=-0, returns 416 with the code range_not_satisfiable and a Content-Range: bytes */size header. Both 200 and 206 responses carry Accept-Ranges: bytes and an ETag that changes whenever the file’s content does. Treat the ETag as opaque. To resume an interrupted download, send the ETag from the first response in If-Range along with a Range that starts where you stopped.