New static content type

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 年 前
Good day.

I cannot load any *.gltf files (part of 3D visualisation), permanent 404 error. Can somebody tell me necessary steps to register this type of files?

Thank you in advance,
Serge
4 年 前
Ok, found solution.

This code should be added to UseNopStatisFiles:


var options = new StaticFileOptions
            {
                ContentTypeProvider = new FileExtensionContentTypeProvider()
            };

            ((FileExtensionContentTypeProvider)options.ContentTypeProvider).Mappings.Add(
                new KeyValuePair<string, string>(".gltf", "model/gltf+json"));

            application.UseStaticFiles(options);
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.