For the complete documentation index, see llms.txt. This page is also available as Markdown.

/download

The download endpoint is used to deliver binary file data. It delivers data for original files as well as renditions. These URL to the files should be taken from the responses of /api/db or /api/search.

GET /eas/download/{fileId}/{hash}/{version}

get

Stored files and renditions are delivered with Content-Length and Accept-Ranges: bytes and answer Range requests with 206. A rendition produced on the fly with recipe or the resize parameters is streamed while it is produced and has no length, unless the recipe writes its output as a file that is then sent (file_out_stream), as the audio snippet recipe does: that response has a length and supports ranges too, so the browser's media player can seek in and replay the snippet.

Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Path parameters
fileIdnumber · int64Required

The ID of the file.

hashstringRequired

The hash of the file as fylr renders it into the file's urls, its hash. A file left on its remote has the MD5 of its remote URL until it is processed, and urls carrying that hash keep working once the content hash is stored.

versionstringRequired

The version name and the file's extension, joined by a dot, such as original.jpg, as fylr renders them into the file's urls; see File Versions.

Query parameters
x-fylr-signaturestringOptional

The signature to omit file permission checks. It will be added to the URL when retrieved through /api/db, /api/search, /api/eas or other endpoints which deliver fylr URLs. The signature will be taken from the query parameter first and if not found, from the request header.

obj_uuidstringOptional

The _uuid of the object the file is linked into. This is used for the permission check.

recipestringOptional

Name of recipe in the form of <cookbook>:<recipe>. If not given, the system recipe _produce:produce is used. In that case, the other url parameters are used as parameters for the recipe.

recipe_paramsstring · jsonOptional

JSON formatted object which sets the parameters for the recipe. The parameter name is the <key> in the object.

formatstring · enumOptional

The target format of the produced file. Defaults to the extension of the file parent. If that extension cannot be produced (for example jfif, which can be read but not written), the default output format of the produce recipe is used (jpg).

Possible values:
sizenumber · intOptional

set the target size

widthnumber · intOptional

set the target width

heightnumber · intOptional

set the target height

resize_modestring · enumOptional
  • "max": "size" is the maximum side
  • "min": "size" is the minimum side
  • "width": "size" is the width * "height"
  • "size" is the height.

If "width" and "height" are given, `resize_mode`` can either be "cover" or "force". "cover" will cut of overflowing pixels, "contain" will not cut off any pixels and "force" will not preserve the aspect ratio. "max" is the default for "size" and "cover" for "width" and "height".

Possible values:
qualityone ofOptional

Quality is used to set the JPEG quality. maximum is 100, medium is 75, small and low are 50.

string · enumOptionalPossible values:
or
number · intOptional
dpinumber · intOptional

DPI of the target image. Values <= 0 are ignored. This sets XResolution, YResolution and ResolutionUnit.

dispositionstring · enumOptional

Answer with Content-Disposition: attachment, so the browser saves the file instead of displaying it inline.

Possible values:
filenamestringOptional

Filename to send in Content-Disposition. Defaults to the original filename of the file.

Header parameters
x-fylr-signaturestringOptional

The signature to omit file permission checks. It will be added to the URL when retrieved through /api/db, /api/search or other endpoints which deliver fylr URLs. The signature will be taken from the query parameter first and if not found, from the request header.

Responses
200

The response will use the proper mimetype for the file.

application/octet-stream
Responsestring · binary

The binary data of the file.

binary

HEAD /eas/download/{fileId}/{hash}/{version}

head
Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Path parameters
fileIdnumber · int64Required

The ID of the file.

hashstringRequired

The hash of the file as fylr renders it into the file's urls, its hash. A file left on its remote has the MD5 of its remote URL until it is processed, and urls carrying that hash keep working once the content hash is stored.

versionstringRequired

The version name and the file's extension, joined by a dot, such as original.jpg, as fylr renders them into the file's urls; see File Versions.

Query parameters
x-fylr-signaturestringOptional

The signature to omit file permission checks. It will be added to the URL when retrieved through /api/db, /api/search, /api/eas or other endpoints which deliver fylr URLs. The signature will be taken from the query parameter first and if not found, from the request header.

obj_uuidstringOptional

The _uuid of the object the file is linked into. This is used for the permission check.

Header parameters
x-fylr-signaturestringOptional

The signature to omit file permission checks. It will be added to the URL when retrieved through /api/db, /api/search or other endpoints which deliver fylr URLs. The signature will be taken from the query parameter first and if not found, from the request header.

Responses
200

The response will use the proper mimetype for the file.

No content

GET /eas/download/{fileId}/{hash}/{version}/{zippath}

get
Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Path parameters
fileIdnumber · int64Required

The ID of the file.

hashstringRequired

The hash of the file as fylr renders it into the file's urls, its hash. A file left on its remote has the MD5 of its remote URL until it is processed, and urls carrying that hash keep working once the content hash is stored.

versionstringRequired

The version name and the file's extension, joined by a dot, such as original.jpg, as fylr renders them into the file's urls; see File Versions.

zippathstringRequired

Path of a file or directory inside a zip file, appended to the download URL of the ZIP itself. A path to a file delivers that file with its own mimetype, a path to a directory delivers a JSON listing of that directory. A trailing / on the download URL lists the ZIP's root.

The ZIP is read on demand, so no version has to be produced and the ZIP's file extension is irrelevant. The file must be stored in a fylr storage location though — filesystem and S3 both work, but a file left at its original URL (leave_on_remote) is rejected with 400 ZipPathNotSupported.

Query parameters
x-fylr-signaturestringOptional

The signature to omit file permission checks. It will be added to the URL when retrieved through /api/db, /api/search, /api/eas or other endpoints which deliver fylr URLs. The signature will be taken from the query parameter first and if not found, from the request header.

obj_uuidstringOptional

The _uuid of the object the file is linked into. This is used for the permission check.

Header parameters
x-fylr-signaturestringOptional

The signature to omit file permission checks. It will be added to the URL when retrieved through /api/db, /api/search or other endpoints which deliver fylr URLs. The signature will be taken from the query parameter first and if not found, from the request header.

Responses
200

The response will use the proper mimetype for the file. In case of a directory, the response will be JSON.

namestringOptional

The name of the file or directory.

pathstringOptional

The full zippath of the file or directory.

sizenumber · int64Optional

The size of the file in bytes, omitted for directories.

mod_timestring · datetimeOptional

The modification time of the entry in UTC, read from the timestamp stored in the ZIP. Omitted for entries the ZIP holds no timestamp for, which includes directories that exist only as a path prefix of their contents.

is_dirbooleanOptional

Indicates if the entry is a file or directory.

[
  {
    "name": "text",
    "path": "text",
    "size": 1,
    "mod_time": "text",
    "is_dir": true
  }
]

HEAD /eas/download/{fileId}/{hash}/{version}/{zippath}

head
Authorizations
AuthorizationstringRequired

Access token in the Authorization header: Authorization: Bearer <token>.

Path parameters
fileIdnumber · int64Required

The ID of the file.

hashstringRequired

The hash of the file as fylr renders it into the file's urls, its hash. A file left on its remote has the MD5 of its remote URL until it is processed, and urls carrying that hash keep working once the content hash is stored.

versionstringRequired

The version name and the file's extension, joined by a dot, such as original.jpg, as fylr renders them into the file's urls; see File Versions.

zippathstringRequired

Path of a file or directory inside a zip file, appended to the download URL of the ZIP itself. A path to a file delivers that file with its own mimetype, a path to a directory delivers a JSON listing of that directory. A trailing / on the download URL lists the ZIP's root.

The ZIP is read on demand, so no version has to be produced and the ZIP's file extension is irrelevant. The file must be stored in a fylr storage location though — filesystem and S3 both work, but a file left at its original URL (leave_on_remote) is rejected with 400 ZipPathNotSupported.

Query parameters
x-fylr-signaturestringOptional

The signature to omit file permission checks. It will be added to the URL when retrieved through /api/db, /api/search, /api/eas or other endpoints which deliver fylr URLs. The signature will be taken from the query parameter first and if not found, from the request header.

obj_uuidstringOptional

The _uuid of the object the file is linked into. This is used for the permission check.

Header parameters
x-fylr-signaturestringOptional

The signature to omit file permission checks. It will be added to the URL when retrieved through /api/db, /api/search or other endpoints which deliver fylr URLs. The signature will be taken from the query parameter first and if not found, from the request header.

Responses
200

The response will use the proper mimetype for the file.

No content

No content

Paths inside a ZIP

The {zippath} form reads one entry out of a ZIP stored as an original or a version — a page of a pages.zip, a file of an archive — without downloading the whole ZIP, range requests included. The ZIP is read on demand: no special version and no particular extension is required, and holding asset_show on the record is enough. It works for files in any connected storage location, S3 included; a file that is not stored in a location — one left at its remote URL via leave_on_remote — fails with ZipPathNotSupported, the endpoint's one restriction.

A directory listing of a ZIP (from 6.35.0) reports each entry's mod_time from the extended UTC timestamp where the archive carries one, instead of the legacy MS-DOS field, and directory entries carry a mod_time as well; size stays omitted for directories.

Last updated