Documentation
Guides and API reference for uploads, image transforms and video.
npm install @cd2/fileboy-react API https://api.fileboy.io
Documentation menu
Zip downloads API reference
The zip downloads endpoints, generated from the OpenAPI document you can download for code generators and API clients: openapi.json or openapi.yaml. See every endpoint for the rest of the API.
https://api.fileboy.ioMany files, or a folder with its subfolders, as one zip streamed as it is made, or a short-lived link a browser can download it from. Making them needs your private key, opening a zip link needs nothing.
/files/zipDownload files as a zip
Streams a zip of up to 1,000 files picked by id, or of every file in a folder (and its subfolders unless recursive is false), as it is made. Folders are kept below the zipped folder, which is the zip's top folder, or below the deepest folder the picked files share; structure: flat puts every file at the top. Names are made safe to unzip anywhere and clashes, ignoring case, become name (2).ext. Images, video, audio, PDFs, Office files and archives are stored, the rest deflated, and zip64 is used past 4 GB. Only the app's own files can go in: other ids are 404 files_not_found unless allowMissing is true. A picked file the virus scan blocks answers with its refusal (403 file_infected, or with the app's holdDownloadsUntilScanned on 409 file_scan_pending, file_scan_failed or file_not_scanned), unless allowMissing is true, which leaves it out and counts it as missing. A folder zip leaves out infected files, and answers with the 409 while one of its files is held. There is no Content-Length. A storage failure after the zip started cuts the connection rather than finishing a zip with files missing.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Fileboy-App | header | string (uuid) | With a personal access token: the id of the app the request is for. Ignored for an app's own keys and scoped keys. |
Request body
application/jsonids | string (uuid)[] | |
folderId | string | null | Every file in this folder, or null for every file in the app. |
folderPath | string | A folder by path, like /Products/Shoes. / is every file. |
recursive | boolean | With a folder, include the files in its subfolders. |
structure | "folders" | "flat" | Keep folders inside the zip, or put every file at the top. |
filename | string | The zip's name, .zip added if missing. No slashes. |
allowMissing | boolean | Zip the files that were found instead of failing when some ids are not. |
Responses
200 | The zip, as an attachment named after filename, the folder or files.zip.application/zip |
400 | validation_error, invalid_id, invalid_folder_path, too_many_files (more than 1,000), zip_too_large (more than 10 GB before compression) or nothing_to_zip (an empty folder).application/json |
401 | No key was sent.application/json |
403 | file_infected: a picked file was found to contain malware. Also the key refusals.application/json |
404 | files_not_found (some ids are not the app's files; the message lists them) or folder_not_found.application/json |
409 | Only for an app with holdDownloadsUntilScanned on: file_scan_pending, the file is still being scanned (try again shortly), file_scan_failed, it could not be scanned, or file_not_scanned, it was skipped (larger than the scan limit, or uploaded while scanning was off).application/json |
429 | delivery_limit_reached: the app is on Free and has served 150% of its monthly delivery allowance, so its files and images are not served until the month ends at midnight UTC. Retry-After is the seconds until then, and beside error and message the body has resetsAt and upgradeUrl. Paid plans are never cut off, and the dashboard's own reads always work. See /docs/delivery/cdn.application/json |
502 | storage_error: a file could not be read before the zip started.application/json |
/files/zip/linkMake a zip link
A link that downloads the zip POST /files/zip would make, without the key, so a browser can download it straight from Fileboy. The request is checked now and kept with the link; the files are looked up again each time it is opened, so files deleted since are left out and a zipped folder includes files added since. It lasts expiresIn seconds, 60 to 3600 (600 by default). An app can have 1,000 zip links that have not expired (409 too_many_zip_links).
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Fileboy-App | header | string (uuid) | With a personal access token: the id of the app the request is for. Ignored for an app's own keys and scoped keys. |
Request body
application/jsonResponses
201 | The link.application/json |
400 | validation_error, invalid_id, invalid_folder_path, too_many_files (more than 1,000), zip_too_large (more than 10 GB before compression) or nothing_to_zip (an empty folder).application/json |
401 | No key was sent.application/json |
403 | An error. error is a short code and message says what went wrong.application/json |
404 | files_not_found (some ids are not the app's files; the message lists them) or folder_not_found.application/json |
409 | too_many_zip_links.application/json |
/zips/{token}Open a zip link
Streams the zip the link was made for, exactly as POST /files/zip would, until the link expires. Needs nothing else: the link is the permission. Every download is counted. Responses are Cache-Control: no-store with X-Robots-Tag: noindex.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
token * | path | string | The last part of the link's url. |
Responses
200 | The zip.application/zip |
400 | An error. error is a short code and message says what went wrong.application/json |
404 | zip_link_not_found, or files_not_found / folder_not_found when everything it was made for has been deleted.application/json |
410 | zip_link_expired.application/json |
429 | delivery_limit_reached: the app is on Free and has served 150% of its monthly delivery allowance, so its files and images are not served until the month ends at midnight UTC. Retry-After is the seconds until then, and beside error and message the body has resetsAt and upgradeUrl. Paid plans are never cut off, and the dashboard's own reads always work. See /docs/delivery/cdn.application/json |
502 | storage_error.application/json |