上传文件到沙盒 | 大装置帮助中心
跳到主要内容

上传文件到沙盒

POST https://sandbox.cn-sh-01.sensecoreapi.cn/studio/sandbox/v1/workspaces/{workspace_id}/sandboxes/{sandbox_id}:uploadFile

请求头(Request Header)

请参考API 使用指南

请求参数(Request Parameters)

名称类型必须位置描述
workspace_idstringpath工作空间 ID
sandbox_idstringpath沙盒 ID
file_namestringbody文件名
target_pathstringbody目标路径
file_contentbytes文件内容(Base64 编码),文件大小不超过50M

请求示例(Request Example)

curl -L -X POST 'https://sandbox.cn-sh-01.sensecoreapi.cn/studio/sandbox/v1/workspaces/01993ca4-edfa-7382-8161-43a4919681ab/sandboxes/c8e381e5-491c-47cf-842b-aacf914a8c35:execute' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data '{
"file_name":"test.png",
"target_path":"/data/test",
"file_content": "aGVsbG8gd29ybGTvvIHvvIHvvIE="
}'

响应(Response)

异常情况请参考异常响应说明

字段类型描述
file_pathstring已上传文件路径

响应示例(Response Example)

  • 正常响应

{
"file_path": "/data/test/test.png"
}