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

Overview

This endpoint streams the raw contents of a previously uploaded file. The response body is application/octet-stream — the file as it was uploaded. The file must be in a downloadable state. A file that is still uploading or is corrupt returns an HTTP 409 error with the code file_not_available. Files that are being deleted or are already deleted return an HTTP 404 error.
Prior to platform version 2.0.0, files that cannot be deleted caused an HTTP 400 error instead.
To download a file by its file_uid instead of its filename, use Download File Content.

Path Parameters

string
required
Identifier of the file to download

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. v2.0.0+
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. v2.0.0+
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. v2.0.0+

Response

The response body is the raw file bytes with Content-Type: application/octet-stream. 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. v2.0.0+ 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. v2.0.0+