.docx not working in web page for users

I made the site in asp,.net vwd 2010 and uploaded a Microsoft Office 2007 document to a IIS6.0 server and it not being able to serve it or allow the user to view it. When user access.. it gives 404 file no found error... while file was still accessible through FTP....IIS 6.0 probably doesn't know what the new Office 2007 file extensions are. IIS 6.0 is Secure By Design. This means that MIME types are in a white list. Everything that isn’t known to the server is hidden by default and thus returns a 404 error. This is an easy problem to solve. You just need to add the new MimeMaps to IIS 6.0. The new maps are as follows:

.xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xltx application/vnd.openxmlformats-officedocument.spreadsheetml.template
.potx application/vnd.openxmlformats-officedocument.presentationml.template
.ppsx application/vnd.openxmlformats-officedocument.presentationml.slideshow
.pptx application/vnd.openxmlformats-officedocument.presentationml.presentation
.sldx application/vnd.openxmlformats-officedocument.presentationml.slide
.docx application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotx application/vnd.openxmlformats-officedocument.wordprocessingml.template
.xlam application/vnd.ms-excel.addin.macroEnabled.12
.xlsb application/vnd.ms-excel.sheet.binary.macroEnabled.12


These maps came from the following MS KB article:

http://support.microsoft.com/kb/936496

To add the new Mime Maps you can do the following:

Open up IIS Manager
Right click the web server and go to Properties
Click MIME Types button
Click New
Add the extension and MIME Type and click OK


For example to add the .docx you would enter in .docx for the Extension and then add in application/vnd.openxmlformats-officedocument.wordprocessingml.document for the MIME Type.

Another method is

To solve this problem, you have to add a MIME type to IIS. To do this, you just follow these simple steps:

  • In the Internet Management console, you go to the properties of the web site, by right clicking onto it.
  • Under “HTTP Headers”, “Mime Types”, you add a new extension (without the leading dot) with the mime type “application/vnd.openxmlformats-officedocument.wordprocessingml.document”.

If it doesn't work then Now you have to restart the web server. Same can be done for downloading *.exe files.

-Vinod K

Comments

Most Viewed Post

solution for facebook static.ak.fbcdn.net waiting

Connect Sony XPLOD MEX-BT2500 Bluetooth CD Receiver with ur mobile

Crystal Report : Show data horizontally (Left to right) i.e. columns as rows

Google+ Followers