2013-03-14 51 views
1

我已经有一个文件处理程序,它处理所有类型的文件(它们从数据库中加载)。 如此配置:从IIS(或任何其他类型的asp文件)下载resx文件

<handlers> 
    <add name="Supertext Document Download" path="*" verb="*" preCondition="integratedMode" type="Supertext.Handlers.FileTypeHandler" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" /> 
</handlers> 

这是我如何访问它们:

https://www.page.com/file/165298/SalesReport-en.resx

不幸的是,RESX文件,我总是得到404。如果我改变文件扩展名,它的工作原理。一个侧面说明:对于文件处理程序,只有文件名之前的id很重要。

我已经看了各种职位,但couldn'f找到任何类似我的问题: How to serve resx file in ASP.NET?
Downloading an aspx page

我想这是一些安全问题?我可以完全访问服务器,因此配置更改不是问题。只要我知道我需要改变什么。

+0

您是否在Web Server中添加了MIME类型? – Win 2013-03-14 19:04:33

+0

不,不是,它其实只是一个标准安装。 – Remy 2013-03-14 20:53:35

+0

http://www.codingstaff.com/learning-center/other/how-to-add-mime-types-to-your-server – Win 2013-03-14 21:01:02

回答

0

实际上.resx默认是受限制的,但是如果你知道你在做什么,你可以在web.config中启用它。

<security> 
     <requestFiltering> 
      <fileExtensions allowUnlisted="true"> 
      <remove fileExtension=".resx" /> 
      <add fileExtension=".resx" allowed="true" /> 
      </fileExtensions> 
     </requestFiltering> 
    </security> 
相关问题