This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Force client application to open download

 
jaron schut
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a downloadservlet that exports a comma-separated-value file to the client. The file contains name / email / etc of people. These should be imported into MS outlook or other applications.

How do I manipulate that MS-outlook or outlook express opens the download. Currently it appears that excel is allways the default program that opens the file.

I tried various contentTypes:

response.setContentType("text/csv");
response.setContentType("application/outlook");
response.setContentType("application/msoutlook");
response.setContentType("application/x-outlook");
response.setContentType("application/x-msoutlook");

It doesn't seem to help. They all have the same effect.

Googling doesn't help either since the search results just get spammed with outlook download attachment tutorials.

Is it possible at all? If possible how do I accomplish it?


Kind regards
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume you're using IE?

The behaviour is different between browsers, but IE also looks at the file extension, you can provide a filename, I just remember how... I'll go look.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I just read that you want to encourage the client to open a CSV in outlook and not Excel. Unfortunately the browser will do whatever the default is, which will usually be Excel.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic