Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCU-2430

How to add an asset with REST tutorial is incomplete

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Medium
    • None
    • None
    • None
    • None

    Description

      This tutorial https://docs.magnolia-cms.com/product-docs/6.2/Developing/Development-how-tos/How-to-add-an-asset-with-REST.html doesn't work completely because you need to be sure that when an asset is uploaded the size of that asset needs to be written to the jcr:content subnode.

      <sv:property sv:name="size" sv:type="Long">
          <sv:value>11380</sv:value>
      </sv:property>
      

      Without the size the asset cannot be used correctly.

      Reproduce
      Follow the instructions to upload the asset (2 rest calls). Then open the asset in the detail subapp or try to use the asset or try to download the asset. Doesn't work.

      Notes
      Not sure how to fix it. Somehow the size of the asset needs to be sent on the second request. Here is how we do it in java when the assets is uploaded through the UI.

      Also the width and height should be sent as well to have a complete asset with all metadata. Otherwise it will have the asset as 1x1.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                mdrapela Martin Drápela
                rgange Richard Gange
                Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR