Expand my Community achievements bar.

SOLVED

Retrieve Image Extension

Avatar

Level 5

Hello Community - We have an image component, in that authors will be selecting images. without having any separate field selection of the image type/extension in the dialog, I wanted to retrieve the selected image extension and based on that, we will perform some logic. is there a way to retrieve the image extension of the selected image in HTL.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

 

Check below code to get the image extension from image resource

 

Image image = new Image(resource); // resource - image resource

image.getExtension();

 

For more details, please refer

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/javadoc/co...

Hope this helps!

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi,

 

Check below code to get the image extension from image resource

 

Image image = new Image(resource); // resource - image resource

image.getExtension();

 

For more details, please refer

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/javadoc/co...

Hope this helps!