簡體   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