Skip to main content

Download Multiple Files

Downloads one or more files from ftpGrid storage.

The endpoint works together with /api/download/prepare.

If a single file is requested, the file is streamed directly as an attachment. If two or more files are requested, ftpGrid automatically generates a ZIP archive containing all requested files.

Downloading files with REST API counts towards bandwidth usage.

Required Scope

file.read

Endpoint

POST /api/download/multi?id=DOWNLOAD_ID

Download Flow

The multi-download workflow consists of two steps:

  1. Prepare download request
  2. Download generated file or archive

Example Prepare Request (HTTPie)

http POST https://webN.ftpgrid.com/api/download/prepare \
Authorization:"Bearer YOUR_TOKEN" \
Filelist[]="/documents/report.pdf" \
Filelist[]="/documents/archive.xlsx"

Raw JSON Body

{
"Filelist": ["/documents/report.pdf", "/documents/archive.xlsx"]
}

Example Prepare Response

{
"rslt": "8e9f6c7b4a2d"
}

Example Download Request (HTTPie)

http POST "https://webN.ftpgrid.com/api/download/multi?id=8e9f6c7b4a2d" \
Authorization:"Bearer YOUR_TOKEN"

Raw JSON Body

This endpoint does not use a request body.

The download identifier is supplied as a URL query parameter:

?id=8e9f6c7b4a2d

Query Parameters

ParameterTypeDescription
idstringDownload preparation identifier returned from /api/download/prepare

Example Response (Multiple Files)

HTTP/1.1 200 OK
Content-Disposition: attachment; filename="ftpgrid_download.zip"
Content-Type: application/zip

Example Response (Single File)

HTTP/1.1 200 OK
Content-Disposition: attachment; filename="report.pdf"
Content-Type: application/octet-stream

Notes

  • The endpoint always returns files as attachments
  • Multiple files are automatically compressed into a ZIP archive
  • Single-file downloads are streamed directly without ZIP generation
  • Download identifiers are temporary and short-lived
  • Files are streamed directly from storage
  • Large downloads are streamed and not fully buffered in memory
  • File paths are validated during the prepare step
  • Invalid or missing download identifiers return an error
  • Authorization is required for both prepare and download requests
  • Paths may contain spaces and UTF-8 characters
  • The endpoint supports very large files and archives depending on account quotas and limits