AppendAttacment
≥4.8.1
不支持在CustomiseAPI中使用WebApi Service的方式调用
接口功能
向指定Document中追加附件
请求参数
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| FormAlias | string | true | 指定Document所属的Form,Form别名, Form的标识 |
| DataId | string | true | 指定操作的Document ID |
| UserName | string | true | 操作人Name |
| UserId | string | true | 操作人StaffCode |
| AttachmentFiledName | string | true | 附件字段Field name |
| Data | Dictionary<string, object> |
true | 附件信息 |
Data说明
| 字段名 | 类型 | 说明 |
|---|---|---|
| fileName | string | 文件名 |
| fileStream | Stream | 文件字节数组 |
| fileUUID | string | 文件标识,可以指定GUID作为值,若不指定,接口自动生成。可通过该字段调用 DownloadAttachment下载附件。 |
| totalSize | long | 文件总大小 |
返回数据类型
参考返回示例
说明
支持转为
HTML的附件类型为:"PPTX","PPT","XLSX","XLS","DOCX","DOC","PDF","CSV","JPG","JPEG","PNG"。系统会根据指定的
AttachmentFiledName判断对应控件的类型,并自动处理转为html的逻辑。该方法不支持分片上传。
输入示例
{
"FormAlias": "DemoFormAlias",
"DataId": "1191c1e6212442d48b21b6e50ebc937a",
"UserName": "DemoUser",
"UserId": "DemoUser",
"AttachmentFiledName": "File",
"Data": {
"fileName": "demp.jpg",
"fileUUID": "",
"totalSize": 51675,
//该值不是正确的文件流,仅做demo MemoryStream to Base64 string
"fileStream": "/9j/4AAQSkZJRgABAgEASABIAAD/4QFIRXhpZgAASUkqAAgAAAAIADEBAgAsAAAAbgAAADIBAgAUAAAAmgAAAGmHBAABcDigZ//Z"
}
}
返回示例
{
"StatusCode": 200,
"Info": "Request (or process) succeeded",
"Data": {
"entityName": "DemoFormAlias",
"dataId": "1191c1e6212442d48b21b6e50ebc937a",
"result": 1,
"msg": "Process successed"
}
}