Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-22660

Make it possible to get the metadata of a single attachment from the REST endpoints

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 16.9.0
    • REST
    • None
    • Unknown

    Description

      Calling .../attachments returns array of attachments metadata like the json below. But, when calling .../attachments/{fileName}, the response is not a json object, but the file binary content and the mimetype.
      As a REST client, one needs to fully download the file, which is not optimal, and re-compute all the of the metadata that one could get from the server, which is not optimal either.
      The only other option is to call the .../attachments REST endpoint. But this is not optimal either as the list of attachments is not paginated and cannot be filtered.

      {
        "id": "xwiki:Sandbox.WebHome@xwikilogo_400x400.png",
        "name": "xwikilogo_400x400.png",
        "size": 79470,
        "longSize": 79470,
        "version": "1.1",
        "pageId": "xwiki:Sandbox.WebHome",
        "pageVersion": "39.1",
        "mimeType": "image/png",
        "author": "XWiki.Admin",
        "authorName": null,
        "date": 1731428868000,
        "xwikiRelativeUrl": "http://localhost:15680/xwiki/bin/download/Sandbox/WebHome/xwikilogo_400x400.png?rev=1.1",
        "xwikiAbsoluteUrl": "http://localhost:15680/xwiki/bin/download/Sandbox/WebHome/xwikilogo_400x400.png?rev=1.1"
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            mleduc Manuel Leduc
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: