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

SOLVED

Retrieve Image Extension

v1101
Level 5
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
Ravi_Pampana
Correct answer by
Community Advisor
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
Ravi_Pampana
Correct answer by
Community Advisor
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