2

All of the handlers below work except the one for .pptx files. Has anyone else had this problem?

Here is what is in the web.config:

<httpHandlers>
      ...
  <add verb="*" path="*.pdf" type="System.Web.StaticFileHandler" validate="true"/>
  <add verb="*" path="*.docx" type="System.Web.StaticFileHandler" validate="true"/>
  <add verb="*" path="*.doc" type="System.Web.StaticFileHandler" validate="true"/>
  <add verb="*" path="*.pps" type="System.Web.StaticFileHandler" validate="true"/>
  <add verb="*" path="*.ppt" type="System.Web.StaticFileHandler" validate="true"/>
  <add verb="*" path="*.pptx" type="System.Web.StaticFileHandler" validate="true"/>
</httpHandlers>
Nicholas Murray
  • 13,305
  • 14
  • 65
  • 84
ryoung
  • 856
  • 1
  • 8
  • 24

2 Answers2

1

If the problem is restricting access to the .pptx file type, try doing the following: Create a custom mapping in IIS by opening the web site properties in IIS, navigating to Configuration -> Mappings -> Add and then adding the .pptx extension. This is necessary because, by default, .NET does not protect non Asp.NET files.

Further information: How to restrict the access to a given folder for a specific role

Nima Derakhshanjan
  • 1,380
  • 9
  • 24
  • 37
Ross Fuhrman
  • 638
  • 4
  • 13
  • 26
0

You have to make sure that IIS knows about the .pptx extension and has the correct mime-type for it.

Downloading Docx from IE - Setting MIME Types in IIS

http://www.bram.us/2007/05/25/office-2007-mime-types-for-iis/

Community
  • 1
  • 1
Anders Marzi Tornblad
  • 18,896
  • 9
  • 51
  • 66
  • In the IIS Manager I went to (local computer) -> Properties -> MIME Types and .pptx was listed. – ryoung Jan 31 '12 at 15:54
  • Also, this configuration is part of restricting access. I.E. I can't browse to a .docx file without logging in but I can open a .pptx file just fine. – ryoung Jan 31 '12 at 16:03
  • So your problem is that you can open pptx files, but you can't open docx files? I thought the problem was with pptx files... Besides, `httpHandlers` has nothing to do with restricting access - that is what the `authorization` element is for. – Anders Marzi Tornblad Jan 31 '12 at 16:10