upload_file_stream

upload_file_stream写操作流式接口
以流式分块方式上传文件到机器人本地(返回可用于发送的本地路径)

Call via POST http://127.0.0.1:3000/upload_file_stream (JSON params as the body) or WebSocket.

Parameters

Param Type Required Default Description
stream_id string 流 ID(客户端生成的 UUID,限 [A-Za-z0-9_-])
chunk_data string 分块数据(Base64)
chunk_index int 分块索引(从 0 开始)
total_chunks int 总分块数(新流必填)
file_size int 文件总大小(字节)
expected_sha256 string 期望的整文件 SHA256(校验)
is_complete bool 是否为最后一个分块/触发合并
filename string 文件名
reset bool 重置并丢弃该流
verify_only bool 仅查询当前流状态
file_retention int 300000 合并文件保留毫秒(0=不回收)

Returns (data)

流式帧:分块确认 type=stream、完成 type=response(含 file_path/file_size/sha256)

Returns the standard OneBot envelope; the data shape is not yet documented.

Examples

curl
Python
JavaScript
Go
SnowLuma SDK
curl -X POST http://127.0.0.1:3000/upload_file_stream \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <access-token>' \
  -d '{"stream_id":"","chunk_data":"","chunk_index":0,"total_chunks":0,"file_size":0,"expected_sha256":"","is_complete":false,"filename":"","reset":false,"verify_only":false,"file_retention":300000}'
Using an AI assistant?

MCP-capable clients can discover and call this action directly — no hand-written HTTP. See MCP.