/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}
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.
Access token in the Authorization header:
Authorization: Bearer <token>.
The ID of the file.
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.
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.
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.
The _uuid of the object the file is linked into. This is used for the permission check.
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.
JSON formatted object which sets the parameters for the recipe. The parameter name is the <key> in the object.
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).
set the target size
set the target width
set the target height
- "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".
Quality is used to set the JPEG quality. maximum is 100, medium is 75, small and low are 50.
DPI of the target image. Values <= 0 are ignored. This sets XResolution, YResolution and ResolutionUnit.
Answer with Content-Disposition: attachment, so the browser
saves the file instead of displaying it inline.
Filename to send in Content-Disposition. Defaults to the
original filename of the file.
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.
The response will use the proper mimetype for the file.
The binary data of the file.
Access to the file is denied (code InsufficientRights):
the caller holds neither asset_show nor asset_download on the
file (holding either one is enough; anonymous requests are checked
against the deep_link user), or the request hash / version
does not match the stored file, or the x-fylr-signature is
invalid or expired. This endpoint returns no 401; a missing or
invalid token is treated as an anonymous request.
The addressed file id does not exist. A wrong hash, wrong
version, or an invalid / expired signature is a 403, not
a 404.
binaryHEAD /eas/download/{fileId}/{hash}/{version}
Access token in the Authorization header:
Authorization: Bearer <token>.
The ID of the file.
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.
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.
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.
The _uuid of the object the file is linked into. This is used for the permission check.
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.
The response will use the proper mimetype for the file.
Access to the file is denied (code InsufficientRights):
the caller holds neither asset_show nor asset_download on the
file (holding either one is enough; anonymous requests are checked
against the deep_link user), or the request hash / version
does not match the stored file, or the x-fylr-signature is
invalid or expired. This endpoint returns no 401; a missing or
invalid token is treated as an anonymous request.
The addressed file id does not exist. A wrong hash, wrong
version, or an invalid / expired signature is a 403, not
a 404.
No content
GET /eas/download/{fileId}/{hash}/{version}/{zippath}
Access token in the Authorization header:
Authorization: Bearer <token>.
The ID of the file.
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.
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.
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.
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.
The _uuid of the object the file is linked into. This is used for the permission check.
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.
The response will use the proper mimetype for the file. In case of a directory, the response will be JSON.
The name of the file or directory.
The full zippath of the file or directory.
The size of the file in bytes, omitted for directories.
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.
Indicates if the entry is a file or directory.
The file cannot serve a path inside its ZIP (code
ZipPathNotSupported), because it is not stored in a fylr
storage location. A zippath that does not exist inside the
ZIP is also a 400, but with the generic ServerGeneric
code.
Access to the file is denied (code InsufficientRights):
the caller holds neither asset_show nor asset_download on the
file (holding either one is enough; anonymous requests are checked
against the deep_link user), or the request hash / version
does not match the stored file, or the x-fylr-signature is
invalid or expired. This endpoint returns no 401; a missing or
invalid token is treated as an anonymous request.
The addressed file id does not exist, or its storage location
no longer holds the file's content (the answer then carries
neither the file's Content-Length nor its Cache-Control).
A wrong hash, wrong version, or an invalid / expired
signature is a 403, not a 404. A zippath that does not
exist inside the ZIP is a 400, not this 404.
[
{
"name": "text",
"path": "text",
"size": 1,
"mod_time": "text",
"is_dir": true
}
]HEAD /eas/download/{fileId}/{hash}/{version}/{zippath}
Access token in the Authorization header:
Authorization: Bearer <token>.
The ID of the file.
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.
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.
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.
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.
The _uuid of the object the file is linked into. This is used for the permission check.
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.
The response will use the proper mimetype for the file.
No content
The file cannot serve a path inside its ZIP (code
ZipPathNotSupported), because it is not stored in a fylr
storage location. A zippath that does not exist inside the
ZIP is also a 400, but with the generic ServerGeneric
code.
Access to the file is denied (code InsufficientRights):
the caller holds neither asset_show nor asset_download on the
file (holding either one is enough; anonymous requests are checked
against the deep_link user), or the request hash / version
does not match the stored file, or the x-fylr-signature is
invalid or expired. This endpoint returns no 401; a missing or
invalid token is treated as an anonymous request.
The addressed file id does not exist, or its storage location
no longer holds the file's content (the answer then carries
neither the file's Content-Length nor its Cache-Control).
A wrong hash, wrong version, or an invalid / expired
signature is a 403, not a 404. A zippath that does not
exist inside the ZIP is a 400, not this 404.
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