Nick Grattan's Blog

About Microsoft SharePoint, .NET, Natural Language Processing and Machine Learning

Posts Tagged ‘CSV SharePoint MIME

SharePoint: Opening CSV files with Microsoft Excel

with 10 comments

By default, if open a .CSV file in a SharePoint the browser will prompt you to save the file. Ideally, you probably want the file to be opened directly in Microsoft Excel. There are two configuration options that need to be made. The instructions here are for SharePoint 2010 but are similar for SharePoint 2007.

  • Add an entry to DOCICON.XML

This file is located by default at: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\XML. Open the file DOCICON.XML for editing and add the following line in the ByExtension element:

<Mapping Key=”csv” Value=”icxltx.png” OpenControl=””/>

This ensures that the Excel icon is displayed alongside CSV files.

Note: if you want to be prompted to open read-only or for edit remove ‘OpenControl=”” ‘ in the Mapping Key.

  • Change the MIME type associated with the CSV Extension in Internet Information Server (IIS)

To do this:

  1. Run the “Internet Information Services (IIS) Manager” application from the Start/Administrative tools menu.
  2. Select the server in the left-hand pane.
  3. Select “MIME Types” in the list of options in the middle pane.
  4. Then locate the .CSV entry (it should already exist) and change the MIME type to: application/, and click OK.

Once these configuration options are complete perform an IIS Reset.

CSV files should now be opened using Excel by default. You will be prompted that a change in file extension has occurred when using Office 2007. You will need to click Yes in this warning message.


Written by Nick Grattan

January 5, 2011 at 9:11 am