繁体   English   中英

Drupal 7 Service Rest API

[英]Drupal 7 Service Rest api

  For a {node} when i am using "GET" for details this is the result 
 "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",

            },

        ]
    }

上面的“ fid”是我通过表单上传时添加的一些方式,但是当我通过json数据上传时,我通过iam在同一人的邮递员中通过json插入时,我只是将“ fid”增加到“ 74”

 "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"
            }


        ]
    }

我想为单个nid设置上传多个图像的“ fid”

这是我得到的结果 在此处输入图片说明

该字段是多上传 在此处输入图片说明

首先命中站点/访问点/文件并发布文件

"fid": "73",
    "uid": "1",
    "filename": "Screenshot from 2018-06-08 12-54-20 (6th copy).png",
    "uri": "public://Screenshot from 2018-06-08 12-54-20 (6th copy).png",
    "filemime": "image/png",
    "filesize": "159999",
    "status": "1",
    "timestamp": "1528444702",
    "type": "undefined",
    "rdf_mapping": [],
    "metadata": [],
    "uri_full": "http://webiste/sites/default/files/Screenshot%20from%202018-06-08%2012-54-20%20%286th%20copy%29.png",
    "target_uri": "Screenshot from 2018-06-08 12-54-20 (6th copy).png",
    "file": "iVBORw0KGgoAAAANSUhEUgAABkAAA

然后您将得到fid。使用fid将其上传到节点

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM