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.
Related
Currently if you add a MIME type through iis as follows:
Open Internet Information Services (IIS) Manager
In the Connections pane, go to the site, application, or directory for
which you want to add a MIME type. In the Home pane, double-click MIME
Types.
In the MIME Types pane, click Add... in the Actions pane.
In the Add MIME Type dialog box, add the file name extension and MIME
type, and then click OK.
IIS will delete the entry when you do an IISRESET. There are some developers doing IISRESET and wiping out the user created mime types. My question is, how can I permanently add a MIME type so that even when a developer does an IISRESET, it will not be wiped out and will remain with the other default mime types. Thanks.
Doing an IIS reset should not reset values. I'd check to see if you have an application startup that does something like that. With that said, you could add the values to the server configuration file in:
C:\Windows\System32\inetsrv\config\applicationHost.config
You'd add your standard mapping as such:
<staticContent>
<mimeMap fileExtension=".ext" mimeType="text/plain" />
</staticContent>
Those values will not get reset during a service restart.
Whenever I click on a link in SharePoint, ex: Excel document, SSRS Report, etc.; I always get an error that the page cannot be found. This is because "_layouts/15/download.aspx?SourceUrl=" is the default behaviour on click.
If I wight click and choose Open in New Tab, then it works fine.
How can I remove "_layouts/15/download.aspx?SourceUrl=" from being the default behaviour on click in SharePoint?
This can be caused by a setting in Central Admin which adds headers to the browser to download certain types of files.
You can change this setting by going to Central Admin >> Manage Web Applications >> select your Web Application >> General Settings and under "Browser File Handling" change it from "Strict" to "Permissive" or vice versa.
The automatic downloading forced by "strict" is a security feature, but can create a terrible user experience. Once it's set to "permissive" you can control the behavior for each MIME type individually, but the defaults should be fine.
If you need to change the settings for a MIME type here's link to do so using powershell: http://www.mssharepointtips.com/tip.asp?id=1187
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'
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?
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.