Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

Assets API Update Rendition Mime Type

btaymaz
Level 2
Level 2

We migrated our assets from another system. Some file extension are not formatted correctly, like "filename.jpg (1)". AEM couldn't figured out mime type, so DAM Update Asset workflow couldn't generate renditions.

 

I tried to add mime type manually via Assets API but I'm getting "Forbidden" error. Any ideas?

 

Spoiler
PUT /api/assets/myfolder/myAsset.png/renditions/original -H"Content-Type: application/json" -d '{"properties":{"jcr:mimeType":"image/jpeg"}}'

 

 

7 Replies
asutosh_jena
Community Advisor
Community Advisor

Hi @btaymaz 

 

You can try in the below way:

  1. Use the PUT request with the asset URL e.g. http://localhost:4502/api/assets/wknd-events/wknd-events.jpg
  2. Set the Authorization type as "Basic Auth" with username and password.
  3. Set the "Content-Type" header as "application/json".
  4. Use the below request body:
{
"properties": {
"metadata" : {
"dam:MIMEtype":"image/jpeg"
}
}
}

 

This will set the mime type on metadata node.

 

Hope this helps!

Thanks 

btaymaz
Level 2
Level 2
This put it to asset level, thumbnail creation looks under "renditions/original"
asutosh_jena
Community Advisor
Community Advisor
All the metadata information are stored under "metadata" node. So you need to pass the information as mentioned above.
btaymaz
Level 2
Level 2
No, this is not true. Each rendition has it's own mimetype, including original
btaymaz
Level 2
Level 2
I'm passing credentials, it works at this level "/api/assets/myfolder/myAsset.png" but not "/api/assets/myfolder/myAsset.png/renditions/original""
Arun_Patidar
Community Advisor
Community Advisor
but original node does not contains any meta property, when you need to set mime type there?