Developer forum

Forum » Swift » Asset extension is case sensitive

Asset extension is case sensitive

Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

Hi,

I had some strange behaviour which turns out to be caused by the code in Swift_ProductDetailsImage.cshtml

This code is case sensitive, so a file with a "Jpg" extension is not rendered.

@* Supported formats *@
supportedImageFormats = new string[] { ".jpg", ".jpeg", ".webp", ".png", ".gif", ".bmp", ".tiff" };
supportedVideoFormats = new string[] { "youtu.be", "youtube", "vimeo", ".mp4", ".webm" };
supportedDocumentFormats = new string[] { ".pdf", ".docx", ".xlsx", ".ppt", "pptx" };
allSupportedFormats = supportedImageFormats.Concat(supportedVideoFormats).Concat(supportedDocumentFormats).ToArray();
 
Also I was somewhat confused by this being harcoded into the view, when the asset category also defined certain supported types:

Replies

 

You must be logged in to post in the forum