Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
The Old Man Posted December 24, 2023 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!
opentype Posted December 24, 2023 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?
The Old Man Posted December 24, 2023 Author 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.
Recommended Posts