Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted December 24, 20231 yr 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!
December 24, 20231 yr In which template exactly do you need this? Is there a file object present already or where does the attachment come from?
December 24, 20231 yr Author 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.