【问题标题】:Drupal 7 Service Rest apiDrupal 7 服务休息 api
【发布时间】:2018-06-08 09:28:41
【问题描述】:
   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 数据上传时,我只是将“fid”增加到 “74” 当我在邮递员中通过json插入同一节点时

 "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上传多张图片

这是我得到的结果

该字段为multiupload

【问题讨论】:

    标签: php json rest drupal


    【解决方案1】:

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

    "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将它上传到节点

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-15
      • 2022-01-08
      • 1970-01-01
      • 1970-01-01
      • 2016-08-27
      相关资源
      最近更新 更多