文档中心 up7 开发 上传 后端 asp.net

分片上传

asp.net发布于 2023-07-24更新于 2026-06-08 18:04

由控件调用,上传文件块数据,根据块偏移(blockOffset)将块数据写入到文件的对应位置

版本:2.1.23

路径:/api/up6/f_post.aspx

代码:https://gitee.com/xproer/up7-asp.net/blob/2.1.23/api/up7/f_post.aspx.cs

语法:

POST f_post.aspx HTTP/1.1

参数:

名称

类型

必须

说明

id

string

文件ID,唯一标识,GUID

uid

int

用户ID,与第三方系统整合使用

pid

string

文件的父级ID

pidRoot

string

文件的根级ID

lenSvr

long

 

文件远程大小

lenLoc

long

文件本地大小

pathLoc

string

文件本地路径

pathSvr

string

文件远程路径

pathRel

string

文件相对路径

blockIndex

int

块索引,基于1

blockOffset

long

当前块在整个文件中的偏移位置

blockOffsetCry

long

当前加密块在整个文件中的偏移位置

Alert_warning_icn仅在开启加密功能时才提供此参数

blockSize

int

 

块原始大小

blockSizeCry

int

块加密大小

Alert_warning_icn仅在开启加密功能时才提供此参数

blockCount

int

 

块总数

blockEncryptAgo

string

块加密算法:aes,sm4

Alert_warning_icn仅在开启加密功能时才提供此参数

blockSizeCpr

int

块压缩大小

Alert_warning_icn仅在开启压缩功能时才提供此参数

blockCprType

string

块压缩方式:gzip,zip

Alert_warning_icn仅在开启压缩功能时才提供此参数

blockMd5

string

MD5

complete

bool

所有块已传完,当前块是最后一块

token

string

安全验证凭证

需要在前端和后端config.json中开启

object_id

string

对象存储服务的唯一标识

 

返回值:

json:{msg,offset,fields}

名称

类型

说明

msg

string

返回给前端的消息

offset

long

-1表示上传错误

fields

object

提供给控件的附加字段信息

后续上传块时,控件会自动附加上此信息


上一篇 文件上传完毕
下一篇 文件初始化