Assets API Update Rendition Mime Type | Community
Skip to main content
btaymaz1
Level 2
May 20, 2021
Question

Assets API Update Rendition Mime Type

  • May 20, 2021
  • 2 replies
  • 2017 views

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?

 

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

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Asutosh_Jena_
Community Advisor
Community Advisor
May 21, 2021

Hi @btaymaz1 

 

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 

btaymaz1
btaymaz1Author
Level 2
May 21, 2021
This put it to asset level, thumbnail creation looks under "renditions/original"
arunpatidar
Community Advisor
Community Advisor
May 21, 2021
Arun Patidar
btaymaz1
btaymaz1Author
Level 2
May 21, 2021
I'm passing credentials, it works at this level "/api/assets/myfolder/myAsset.png" but not "/api/assets/myfolder/myAsset.png/renditions/original""