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

file_id string (必选)File ID

Request example

curl "$AGENTSTUDIO_URL/files/file_xxx/content" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"

Response

On success, the raw binary stream of the file is returned.

Error codes

HTTP statusError codeDescription
400invalid_request_errorFile '...' is not downloadable
401InvalidApiKeyInvalid API-key provided.
404not_found_errorFile not found.