• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending attachments with HTTPS / SSL using servlets

 
Arno Diederik
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have the following problem. I had a servlet running with HTTP (IPlanet 6 and Tomcat 4, using jdk1.3, jsse installed) which returned a comma seperated file using the following code:

//name variable is filled
....
response.setContentType("text/plain");
response.setHeader("content-disposition", "attachment;filename=\"" + name + ".txt\"");
...
// not interesting code
// line.toString does return a value
...
out.println(line.toString());
out.flush();
out.close();

This worked fine, however now I want to do the same while using HTTPS. This results in a download problem, because
the browser claims that the file does not exist. JSP's seams to work fine.

When I remove the "response.setHeader" line, the contents of the generated file, appears in the browser window just fine, but I want to force the download.

So this leads to my question, if it is possible to send attachments with HTTPS using a servlet? Is there a solution to my problem? Are there other suggestions???

Thanks in advance,

Regards,


Arno Diederik
 
Philip Shanks
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which browser? IE has a setting to prohibit saving files to disk from secure sessions, and you will want to check this.
"Tools->Internet Options...->Advanced"
Scroll to the bottom and make sure that "Do not save encrypted pages to disk" is unchecked.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic