简体   繁体   English

无法访问 wwwroot 中具有特定格式的文件

[英]Can't access a file with a specific format in wwwroot

I have a Asp.Net Blazor project.我有一个Asp.Net Blazor项目。 I can access files in a normal format like .svg !我可以访问正常格式的文件,例如.svg There is a file in .riv format that I can't access that file.有一个.riv格式的文件,我无法访问该文件。

在此处输入图像描述

I can see all of the static file in this dashboard.我可以在此仪表板中看到所有 static 文件。

在此处输入图像描述

And then I can access to a file in a normal format like c-sharp-icon.svg然后我可以访问正常格式的文件,如c-sharp-icon.svg

在此处输入图像描述

But I cant access to this file in .riv format.但我无法以.riv格式访问此文件。

在此处输入图像描述 在此处输入图像描述

This is my StaurtUp config for access to static files.这是我的 StaurtUp 配置,用于访问 static 文件。

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

For more information about.riv format: ( https://rive.app/ )有关.riv格式的更多信息:( https://rive.app/

As mentioned in the docs , only about 400 file types are served by default.文档中所述,默认情况下仅提供大约 400 种文件类型。

You could use the ServeUnknownFileTypes parameter of UseStaticFiles (which is discouraged) or manually specify additional file types with their content type as mentioned here .您可以使用 UseStaticFiles 的 ServeUnknownFileTypes 参数(不鼓励这样做)或手动指定其他文件类型及其内容类型,如此所述。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM