The Old Man Posted December 24, 2023 Share Posted December 24, 2023 Hi folks, Is there a provided method already in IPS4 to obtain the file type or extension of an uploaded image attachment resource, or do we have to do it manually in theme templates? If I know what an image file type is already because I supplied it I can use this: href="{resource="my.webp" app="core" location="front"}" type="image/webp" but if a user uploads their image, I need to set the correct image type from the resource itself. Many thanks! Link to comment Share on other sites More sharing options...
opentype Posted December 24, 2023 Share Posted December 24, 2023 In which template exactly do you need this? Is there a file object present already or where does the attachment come from? Link to comment Share on other sites More sharing options...
The Old Man Posted December 24, 2023 Author Share Posted December 24, 2023 Hi, The resource is a standard custom image upload originating from a custom theme setting. A user (admin) can upload an image which could be any accepted file type. I want to preload it, so it requires e.g. a type="image/webp" HTML attribute. Regarding the template, it’s just a custom HTML theme template. Link to comment Share on other sites More sharing options...
Recommended Posts