• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Force client application to open download  RSS feed

 
Greenhorn
Posts: 5
  • 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
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!