views:

338

answers:

2

Hi,

I have got folder "binaries" in my web application. I would like to download pdf and doc (static ontent) files from that direcotory but when i try to get them i have got error 404. I tried to set up static module for *.doc and *.pdf but it not works.

+1  A: 

StaticFileHandler should work. I had the same problem with *.bz2 files and I have solved it using StaticFileHandler. You can find configuration I used below:

<httpHandlers>
      <remove verb="*" path="*.asmx"/>
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
      <add verb="*" path="*.mvc" validate="false" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add verb="*" path="*.bz2" type="System.Web.StaticFileHandler" validate="false" />
</httpHandlers>
Marcin Obel
I tried adding handlers but everytime I made request for .doc file I am getting 404. The static files are placed inside application subdirectory. When I moved the files to the root directory I am able to view them without 404...
marcinn
A: 

I converted my directory with binaries (docs, pdf etc.) to application and this resolved my problem with 404 and static files.

marcinn