Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating and storing .msg file on local system  RSS feed

 
Ravidatt
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to store a file in microsoft outlook .msg format on my local machine by using Java most probably JNI so that when user click on the .msg file it could open in MS Outlook.
please help if anybody has done it.
Regards
--------------------
 
Krovi DVSR Sarma
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
Could you get any answer for this problem? If so, can you just append it here.

Krovi.
 
Moxley Stratton
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From inside a servlet:

response.setContentType("application/octet-stream");
String name = "test.msg";
response.addHeader("Content-Disposition", "attachment; filename="+name);
String path = "/home/user/msg/" + name;
InputStream input = new FileInputStream(path);
OutputStream out = response.getOutputStream();
int ch;
while ( (ch = input.read()) != -1 ) {
out.write((char) ch);
}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!