I have uploaded an image to alfreso repository. Renditions are also generated for the image file node.
Now I want to get image and display in front-end. Which Alfresco API can be used to create image-url using the renditions from the image. Please suggest what can be done to cretae - imageUrl for <img [src] = "imageUrl"> in html file.
Please suggest.
Thanks,
Santosh.
You can use either the CMIS API or the Public REST API to list renditions. Here is the Public REST API swagger docs on renditions: https://api-explorer.alfresco.com/api-explorer/#!/renditions/listRenditions
Once you have the node reference of the rendition you want, you can refer to it similar to any other node reference. Here is a link that downloads the image from Alfresco:
http://localhost:8080/alfresco/s/api/node/workspace/SpacesStore/e061a117-009f-4a3b-9c25-f5238c669d87/content/thumbnails/doclib
Here is the same link, but this one includes arguments for that cause the rendition to be queued for creation if it does not already exist (queue) and one that returns the placeholder image if the rendition does not already exist (ph).
http://localhost:8080/alfresco/s/api/node/workspace/SpacesStore/e061a117-009f-4a3b-9c25-f5238c669d87/content/thumbnails/doclib?c=queue&ph=true
If instead you want to download the image using the user's Share session, you would do so via the Share proxy, like:
http://localhost:8080/share/proxy/alfresco/api/node/workspace/SpacesStore/e061a117-009f-4a3b-9c25-f5238c669d87/content/thumbnails/doclib?c=queue&ph=true
Hope that helps.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.