[DOCU-2430] How to add an asset with REST tutorial is incomplete Created: 12/Apr/22  Updated: 04/Oct/22  Resolved: 16/Sep/22

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Richard Gange Assignee: Martin DrĂ¡pela
Resolution: Done Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2022-09-16-12-13-46-124.png     PNG File image-2022-09-16-12-20-38-061.png     PNG File missing-metadata.png    
Issue Links:
relation
is related to MGNLREST-359 Cannot put nodes with colons in the name Closed
is related to MGNLREST-349 Creating asset via rest is not possib... Closed
is related to MGNLDAM-1018 Upload asset command Open
Template:
Acceptance criteria:
Empty
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 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.


Generated at Mon Feb 12 01:27:04 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.