title: IE unable to download CSV files from SharePoint 2010 document library
body: <p>I developed a web app in SP2010. The entire app is done in JavaScript with SPServices, since the customer (the Marine Corp.) doesn't want to allow any .NET development in their environment. The customer wanted to be able to download all of the reports in Excel spreadsheets so they can do whatever they do with them. Since it's impossible to generate Excel spreadsheets in JavaScript, the workaround I came up with was to generate a CSV in JavaScript, and save it to a document library, then point the browser to the CSV file for download. This worked perfectly. Even though it wasn't technically Excel, the customer didn't know any better. It just provided what they asked for: open the report in Excel. But the other day, the customer said the Export stopped working. I've spent about a day and a half trying to see what's wrong, find a solution, all that jazz. Here's what I've noticed:</p>
  
  <ul>
  <li>The ".csv" extension is being changed by the browser to "_csv"</li>
  <li>When you click "Save" in the download dialog, the browser reports "[filename]_csv couldn't be downloaded [Retry] [Cancel]"</li>
  <li>When looking at the response headers from the SP server using a protocol analyzer, the SP server is giving the browser the correct file name in the content disposition</li>
  <li>The problem exists in all versions of IE, but works fine in FF. No testing done for Chrome/Safari</li>
  </ul>
  
  <p>Here's the HTTP response headers from the SP2010 server:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Cache-Control   private,max-age=0
  Content-Length  27739
  Content-Type    application/octet-stream
  Expires Sun, 28 Jul 2013 13:42:43 GMT
  Last-Modified   Mon, 12 Aug 2013 13:42:43 GMT
  ETag    "{AE0131B1-3C1D-4E24-BB97-D4D0EB8C69F2},20"
  Server  Microsoft-IIS/7.5
  SPRequestGuid   903d68dc-6f49-4fd8-acbc-2b22c4ee28ef
  Set-Cookie  WSS_KeepSessionAuthenticated={cbef9658-700b-421b-87d5-08fbdc520faf}; path=/
  X-SharePointHealthScore 0
  ResourceTag rt:AE0131B1-3C1D-4E24-BB97-D4D0EB8C69F2@00000000020
  X-Content-Type-Options  nosniff
  Content-Disposition attachment; filename=test.csv
  X-Download-Options  noopen
  Public-Extension    http://schemas.microsoft.com/repl-2
  Set-Cookie  WSS_KeepSessionAuthenticated={cbef9658-700b-421b-87d5-08fbdc520faf}; path=/
  X-Powered-By    ASP.NET
  MicrosoftSharePointTeamServices 14.0.0.6029
  Date    Mon, 12 Aug 2013 13:42:42 GMT
  </code></pre>
  
  <p>Since IE seems to be the only browser affected, I'm unsure if the issue is with the server response. But then again, I come from a LAMP development background, so some of these headers are foreign to me. I was hoping someone out there in Internet-land would have some idea of what's going on here, or have <strong>something</strong> that will give me even a little clue as to what might have changed (apparently overnight) or what the problem could be.</p>
  
  <p>Here's a full fiddler capture, with the URL and filename removed for security, as well as the file contents. I <strong>had</strong> to remove these items because it's a Marine Corp. application and data.</p>
  
  <pre><code>GET http://removed_for_security/Reports/filename.csv HTTP/1.1
  Accept: */*
  Accept-Language: en-US
  User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; MDDC; InfoPath    .3)
  Accept-Encoding: gzip, deflate
  Host: sp2010dev
  DNT: 1
  Connection: Keep-Alive
  Cookie: WSS_KeepSessionAuthenticated={cbef9658-700b-421b-87d5-08fbdc520faf}
  
  
  HTTP/1.1 200 OK
  Cache-Control: private,max-age=0
  Content-Length: 27739
  Content-Type: application/octet-stream
  Expires: Sun, 28 Jul 2013 19:48:33 GMT
  Last-Modified: Mon, 12 Aug 2013 19:48:33 GMT
  ETag: "{AE0131B1-3C1D-4E24-BB97-D4D0EB8C69F2},30"
  Server: Microsoft-IIS/7.5
  SPRequestGuid: a39fa60c-5b8c-4b8c-bb8c-bc1f72ab0351
  Set-Cookie: WSS_KeepSessionAuthenticated={cbef9658-700b-421b-87d5-08fbdc520faf}; path=/
  X-SharePointHealthScore: 0
  ResourceTag: rt:AE0131B1-3C1D-4E24-BB97-D4D0EB8C69F2@00000000030
  X-Content-Type-Options: nosniff
  Content-Disposition: attachment; filename=filename.csv
  X-Download-Options: noopen
  Public-Extension: http://schemas.microsoft.com/repl-2
  Set-Cookie: WSS_KeepSessionAuthenticated={cbef9658-700b-421b-87d5-08fbdc520faf}; path=/
  X-Powered-By: ASP.NET
  MicrosoftSharePointTeamServices: 14.0.0.6029
  Date: Mon, 12 Aug 2013 19:48:32 GMT
  
  file_contents
  </code></pre>
  
  <p>Thanks in advance.</p>