2013-03-14 34 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> 
相關問題