• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 571
  • Last Modified:

What to set as mimetype for .csv files to open in MS excel after download

I m writing a web application in J2EE. When my users click on a particular link, I write  a csv file and it will be downloaded on the client's machine. I want the file to open up in MS Excel automatically after download instead of prompting the user to choose an application. What MIME type do I need to set in this case? I am setting the following
response.setContentType("text/csv");
response.setHeader("Content-Disposition","test.csv");
0
supreeths84
Asked:
supreeths84
  • 3
  • 2
1 Solution
 
for_yanCommented:
Looks like text/csv should be OK

I never had any issues with that - it always opens in Excel automatically
even though I didn't specify anything in mime/type
0
 
for_yanCommented:
Just when i place this link  - it causes Excel to open
http://server.company.com/app_name/images/gifs/1303492568072.csv
whe folks click on it
0
 
for_yanCommented:
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
objectsCommented:
use application/vnd.ms-excel
0
 
objectsCommented:
> response.setContentType("text/csv");

that won't necessarily open excel
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now