Skip to main content

Download File

Downloads file content, returning the raw binary stream directly (not JSON, not a pre-signed URL). The response includes Content-Type and Content-Length headers. Only files with downloadable=true can be downloaded; direct-upload and session sandbox copy files currently have downloadable=false and return 400.

Prerequisites

Endpoint and authentication configured. For details, see Overview and authentication.

Endpoint

GET /files/{file_id}/content

Path parameters

FieldRequiredTypeDescription
file_idYesstringFile ID

Request example

curl -X GET "$AGENTSTUDIO_URL/files/file_xxx/content" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -o downloaded_file.csv

Response

The response body is the raw binary stream of the file. The response headers include:
  • Content-Type: matches the file's actual type
  • Content-Length: file size in bytes

Error codes

HTTP statusError codeDescription
400invalid_request_errorFile is not downloadable (downloadable is false)
401InvalidApiKeyInvalid API key provided
404not_found_errorFile not found
Managed Agent API
Flow Agent API
Sandbox API
RAG API
Long-term Memory
ParseX API
Security API
Framework Integration