Link to home
Start Free TrialLog in
Avatar of supreeths84
supreeths84

asked on

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");
Avatar of for_yan
for_yan
Flag of United States of America image

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
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
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
> response.setContentType("text/csv");

that won't necessarily open excel
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.