cargopanel logocargopanel for developers

Get File by Filename

GEThttps://api.cargopanel.co/v1/files/:filename
GEThttps://sandbox-api.cargopanel.co/v1/files/:filename

Streams the raw file directly from storage. This endpoint does not require an API token: access is granted by the file name itself, which is signed by Cargopanel and cannot be guessed or derived from the file id or user id. Use the fileName or url returned by the upload or metadata endpoints. Anyone who has the link can download the file, so share it only with parties that should see the document. Invalid, modified or unknown file names return 404.

Request Fields

filenamerequiredstring

The signed file name returned by the upload endpoint (e.g. 48213907Xk3fP9qLmZ2vQa).

Example Response

200
Streams binary data of the file with appropriate headers, e.g.:
Content-Type: application/pdf
X-Content-Type-Options: nosniff
Cache-Control: private, max-age=3600

Responses

200File downloaded successfully
404File not found or file name is invalid