Jump to content

How to get the file extension of a resource (image)

Recommended Posts

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


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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...