Question

I've already got a filehandler that servers all types of files (they are loaded from the DB). This is the configuration:

<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>

This is how I access them:

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

Unfortunately, for resx file, I always get a 404. If I change the file extension, it works. A side note: for the filehandler, only the id before the filename matters.

I've looked at various posts, but couldn'f find anything resembling my issue: How to serve resx file in ASP.NET?
Downloading an aspx page

I guess it's some security issue? I have full access to the server, so config changes are not an issue. As long as I know what I need to change.

Was it helpful?

Solution

Actually, .resx are restricted by default, but you can enable it in th web.config if you know what you are doing.

    <security>
      <requestFiltering>
          <fileExtensions allowUnlisted="true">
             <remove fileExtension=".resx" />
             <add fileExtension=".resx" allowed="true" />
          </fileExtensions>
      </requestFiltering>
    </security>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top