Home > Net >  Can't access a file with a specific format in wwwroot
Can't access a file with a specific format in wwwroot

Time:08-01

I have a Asp.Net Blazor project. I can access files in a normal format like .svg! There is a file in .riv format that I can't access that file.

enter image description here

I can see all of the static file in this dashboard.

enter image description here

And then I can access to a file in a normal format like c-sharp-icon.svg

enter image description here

But I cant access to this file in .riv format.

enter image description here enter image description here

This is my StaurtUp config for access to static files.

var app = builder.Build();
app.UseStaticFiles();
app.UseDirectoryBrowser();

For more information about .riv format: (https://rive.app/)

CodePudding user response:

As mentioned in the docs, only about 400 file types are served by default.

You could use the ServeUnknownFileTypes parameter of UseStaticFiles (which is discouraged) or manually specify additional file types with their content type as mentioned here.

  • Related