Php Drupal7服务RESTAPI
上面的“fid”是我通过表单上传时添加的一些内容,但是 当iam通过json数据上传时,我只是将“fid”增加到 "74" 当iam通过邮递员中的json为同一节点插入时Php Drupal7服务RESTAPI,php,json,rest,drupal,Php,Json,Rest,Drupal,上面的“fid”是我通过表单上传时添加的一些内容,但是 当iam通过json数据上传时,我只是将“fid”增加到 "74" 当iam通过邮递员中的json为同一节点插入时 "field_attachment_file": { "und": [ { "fid": "73", "filename": "Screenshot from 2018-06-08 12-54-2
"field_attachment_file": {
"und": [
{
"fid": "73",
"filename": "Screenshot from 2018-06-08 12-54-20.png",
"uri": "public://Screenshot from 2018-06-08 12-54-20_2.png",
"filemime": "image/png",
"status": "1",
"type": "undefined",
},
]
}
"field_attachment_file": {
"und": [
{
"fid": "74",
"uid": "1",
"filename": "Screenshot from 2018-06-08 12-54-20.png",
"uri": "http://webiste/api/v1/file/66",
"filemime": "image/png",
"status": "1",
"type": "undefined"
}
]
}
我想设置“fid”,以便为单个nid上载多个图像
这是我得到的结果
该字段是多上传的第一个点击站点/访问点/文件,然后发布文件
"field_attachment_file": {
"und": [
{
"fid": "73",
"filename": "Screenshot from 2018-06-08 12-54-20.png",
"uri": "public://Screenshot from 2018-06-08 12-54-20_2.png",
"filemime": "image/png",
"status": "1",
"type": "undefined",
},
]
}
"field_attachment_file": {
"und": [
{
"fid": "74",
"uid": "1",
"filename": "Screenshot from 2018-06-08 12-54-20.png",
"uri": "http://webiste/api/v1/file/66",
"filemime": "image/png",
"status": "1",
"type": "undefined"
}
]
}
然后您将获得fid。使用fid将其上载到节点
"field_attachment_file": {
"und": [
{
"fid": "73",
"filename": "Screenshot from 2018-06-08 12-54-20.png",
"uri": "public://Screenshot from 2018-06-08 12-54-20_2.png",
"filemime": "image/png",
"status": "1",
"type": "undefined",
},
]
}
"field_attachment_file": {
"und": [
{
"fid": "74",
"uid": "1",
"filename": "Screenshot from 2018-06-08 12-54-20.png",
"uri": "http://webiste/api/v1/file/66",
"filemime": "image/png",
"status": "1",
"type": "undefined"
}
]
}