Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/246.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Drupal7服务RESTAPI_Php_Json_Rest_Drupal - Fatal编程技术网

Php Drupal7服务RESTAPI

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

上面的“fid”是我通过表单上传时添加的一些内容,但是 当iam通过json数据上传时,我只是将“fid”增加到 "74" 当iam通过邮递员中的json为同一节点插入时

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


        ]
    }