cURL
filename is obtained automatically from the form part; mime_type is detected server-side. After upload, the file enters safety review; only the available status can be mounted or used as message content.
Upload limits
| Dimension | Limit |
|---|---|
| Single file size | 50 MB |
| Total file capacity per workspace | 100 GB |
| Retention | 30 days; files beyond this period may be automatically cleaned up — re-upload periodically for long-term retention |
Scope
Files returned by a normal upload have no scope field (workspace-shared by default). When a file is mounted to a session sandbox, the server makes an internal copy and generates a new file_id; the copy's metadata carries scope: {"type": "session", "id": "sesn_..."} and is visible only to that session.Authorizations
string
header
required
DashScope API Key
Body
multipart/form-datafile
required
要上传的文件,最大 50 MB。filename 自动从表单部分获取,mime_type 由服务端检测
Response
200-application/json
string
文件 ID,格式 file_<24位字母数字>(如 file_maznwes8t9rsysg5r5enkvpr)
string
固定为 file
string
文件名(自上传时表单部分解析得到)
boolean
是否支持下载。当前接口直传与会话沙箱拷贝均为 false
string
服务端检测的 MIME 类型
integer
文件大小,单位字节
enum<string>
安全审核状态:available(通过,可挂载)/ checking(审核中)/ rejected(内容未通过)/ type_rejected(类型不支持)。新上传文件默认 checking
checking,available,rejected,type_rejected
string
上传时间,ISO 8601
string
本次请求的唯一标识。Python SDK 中对应属性为 request_id