Setting Global MIME types in w2k3 - iis

When setting MIME types in IIS 6.0 I understand that to set them globally I right click on Web Sites / Properties. This is useful if I have a clean server as each new website I create then inherits these properties.
Issue I have currently is I have a server with 200 existing web sites. If I add a global MIME type I am given two inheritence popups (one for UNC password and one for MIME types). If I select any of these and click OK my global MIME types override any custom MIME types I have set.
Shorter question: I need to add new MIME types that apply to all existing sites under IIS 6.0 without over writing or removing any existing custom MIME types individual sites may already have set. Is there any way to do this?

Related

How to change the source of a content type on SharePoint online?

I have created this content type called Enhanced Folder.
its source it says it is communication site
I then created a site called Home. My problem is that when I go to the document library then to library settings and Add from existing site content types. I dont see me content type Enhanced Folder.
Did you create the content type in the Same Site as a Site level content type or did you create it in a different library? If you are wanting to share content types around your environment you would want to use the Content Type Hub. You can then create your very general content types in one location and each other site will be able to subscribe to the Content Type Hub to get the content types and associated Site Columns from there.

Inherited vs local MIME type

I am trying to add a MIME type.
After adding it, the browser does not recognize the type.
When I compare it to the demo that works, the only difference that I can see is that in the demo the Entry type is inherited and the one I produce Is Local.
Could anyone explain the difference (I was unable to find anything about it on google).
How do I produce inherited MIME type? (on the demo is was just created that way, but on the beta site it is create as Local!?!)
BTW, in both demo and beta site it is version 6.1.
Thank you very much
You can specify MIME types at different levels.
When looking at a web site and seeing that the Entry Type is Inherited it means the site inherits this MIME type from the server level configuration.
Select the server node and then the MIME types icon, here you see all local entry types. You can add a new MIME type here, it will then show up as inherited type in all your web sites.
A local MIME type at the site level should still work.

IIS7 returns 404 on some static files, not others

I have a css file and a js file in a directory. The css file returns 200 OK while the js file returns 404 Not Found.
They have the same permissions. IUSR, IIS_IUSRS, Internet Guest Account all have (at least) Read.
Add the file type to IIS MIME TYPES.
It wont serve unknown file types.
Adding the file type to the IIS MIME Types worked for me. Fortunately for caveman-brains like mine, IIS let's you do this with the UI.
From the MS website
To use the UI
Open IIS Manager and navigate to the level you want to manage. For information about opening IIS Manager, see Open IIS Manager (IIS 7).
For information about navigating to locations in the UI, see
Navigation in IIS Manager (IIS 7).
In Features View, double-click MIME Types.
In the Actions pane, click Add.
In the Add MIME Type dialog box, type a file name extension in the File name extension text box. For example, type .xyz
Type a MIME type in the MIME type text box. For example, type 'application/octet-stream'

IIS Page cannot be found error

I have an IIS site setup to allow browsing, in a certain subfolder I have some files with .zfo extension.
When I browse using IIS - I can see the file name - but when I click the file I get a 404 file not found exception, any ideas why IIS won't see this file?
To serve .zfo-files do this:
Open the IIS Microsoft Management
Console (MMC), right-click computer
name, and then click Properties.
Click MIME Types.
Click New.
In the Extension box, type .zfo
In the MIME Type box, type application/octet-stream
Apply the new settings
Recycle application pool.
If you want to serve all files regardless of the file name extension (for example, if you cannot predict all files that will be served), follow these steps to add a wildcard character mapping:
Note You should only add the wildcard mapping to the IIS MIME map as a temporary solution during troubleshooting. After you have determined that a missing MIME type is the cause of the issue, remove the wildcard mapping and add the specific mapping for the MIME type that you need to serve.
Open the IIS Microsoft Management Console (MMC), right-click the local computer name, and then click Properties.
Click MIME Types.
Click New.
In the Extension box, type an asterisk (*).
In the MIME Type box, type application/octet-stream.
Apply the new settings. Note that you must restart the World Wide Web Publishing Service or wait for the worker process to recycle for the changes to take effect.
Note In addition to making these changes at the global level in IIS, you can add necessary MIME types at lower levels in the metabase. When you do this, you can specify the sites or directories that are permitted to serve content with a specific file name extension instead of globally allowing all sites to serve that extension.
You will have to add the .zfo extension as a MIME type in IIS.
Try this TechNet article for the full detials.

Downloading Docx from IE - Setting MIME Types in IIS

I am sure there is a simple answer to this one.
I have a docx file that I get an error when trying to download(document cannot be found).... .doc is fine .txt is also fine. I am sure this is just an iis setting, the permissions on the server are all the same for all files.
Yes, it's just an IIS setting: by default, it will only serve files for which the extension matches a defined MIME type.
To allow .docx files to be downloaded, follow the steps from the KB article linked above:
Open the IIS Microsoft Management Console (MMC), right-click the local computer name, and then click Properties.
Click MIME Types.
Click New.
In the Extension box, type the file name extension that you want (in this case, .docx).
In the MIME Type box, type application/vnd.openxmlformats-officedocument.wordprocessingml.document (thanks to #web developer for pointing out this MIME type, which supercedes the 'application/msword' from my original answer).
Apply the new settings. Note that you must restart the World Wide Web Publishing Service or wait for the worker process to recycle for the changes to take effect. In this example, IIS now serves files with the .docx extension.
Note that the KB article uses the generic application/octet-stream MIME type: although that generally should work, if a more specific MIME type exists, such as application/msword, it's always best to use that.
In step 5 of the solution above you said
In the MIME Type box, type application/msword.
The "application/msword" MIME type is the type for the word 2003 ".doc" files. The correct MIME type for word 2007 ".docx" files is:
application/vnd.openxmlformats-officedocument.wordprocessingml.document
See this post.
Thanks this is very useful.
If you are interested MIME type for .pptx (Powerpoint 2007) is
application/vnd.openxmlformats-officedocument.presentationml.presentation
and .xlsx (Excel 2007) is
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
[These where transposed. I have corrected now, thanks for pointing it out Sven.]
When there is no mime type associated with an extension in IIS (6.0 and up), it will give you 404. See Requests for static files return 404 error (IIS 6.0). (Edit: The original MSDN link is dead as of mid-2017, the Internet Archive has a copy. Even though it was written for IIS6, the information still applies to modern IIS versions.)
Other than that, and just because you did not specify where the error shows up: When you forbid caching in a header, similar behavior may occur on the client. But that is a general issue, and not bound to .docx.

Resources