node.js - Couchbase Sync 网关 - 文件上传为附件
问题描述
如何使用 Sync-gateway 从节点 js 将图像文件上传到沙发库
上传后的沙发基础图像文档应如下所示
> "_attachments": { > "blahblahblah.jpeg": { > "content_type": "image/jpg", > "digest": "blahblahblah", > "length": 99999, > "revpos": 1, > "stub": true > }
注意:Couchbase 版本是 Community Edition 5.0.0
解决方案
你的沙发底座和 SGW 的版本是什么?插入附件的正确形式是 throw Sync gateway
you need check REST API Sync gateway in the documentation of couchbase
以其他方式,您可以尝试在 base 64 中转换图像并使用字符串在文档中设置一个字段 this throw SDK for NODE JS
推荐阅读
- c++ - C++20: boost::algorithm::to_lower(std::u8string)
- javascript - 在二维数组中查找嵌套的最小/最大数组
- java - 如何在 jPanel 中重新调整多边形的大小?
- excel - 根据条件仅获取 Excel 中表格的一部分
- android - 安卓应用的横幅广告数量限制
- javascript - 检查函数作为参数的参数数量
- python - Pip 在基本 conda 环境中不起作用
- r - 在 plotly R 中显示 Boxplot 中数据点的最大值和最小值
- html - 我错过了什么?Flexbox 不在此代码段中将容器居中
- json - F# 使用嵌套列表为 Json 定义类型