curl -X POST \
-H "X-LC-Id: ------------" \
-H "X-LC-Key: -------------" \
-H "Content-Type: application/json" \
-d '{
"name": "hjiang",
"picture": {
"id": "543cbaede4b07db196f50f3c",
"__type": "File"
}
}' \
https://***.api.lncld.net/1.1/classes/Staff


请问应如何操作,使得我上传的文件能被关联到File类型的字段中,谢谢
另外:
"name": "hjiang", 指的是什么
https://***.api.lncld.net/1.1/classes/Staff 中的Staff是指表名吗?

您好,在终端粘贴以下代码并执行,就可以关联文件到对象( X-LC-Id 和 X-LC-Key 替换成你自己的)。Staff 是你要关联到的对象的表名。"name": "hjiang" 指的是 Staff 表有一个字段名是 name。

curl -X POST \
-H "X-LC-Id: ------------" \
-H "X-LC-Key: -------------" \
-H "Content-Type: application/json" \
-d '{
"name": "hjiang",
"picture": {
"id": "543cbaede4b07db196f50f3c",
"__type": "File"
}
}' \
https://***.api.lncld.net/1.1/classes/Staff

你执行这段代码以后,就在 Staff 表中新建了一个对象,Staff 表有两个字段 name 和 picture,上传的文件关联到 picture 字段,name 被赋值 hjiang。