Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Sending attachments with HTTPS / SSL using servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Sending attachments with HTTPS / SSL using servlets" Watch "Sending attachments with HTTPS / SSL using servlets" New topic
Author

Sending attachments with HTTPS / SSL using servlets

Arno Diederik
Greenhorn

Joined: Apr 29, 2003
Posts: 3
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

Joined: Oct 15, 2002
Posts: 189
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.


Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
 
jQuery in Action, 2nd edition
 
subject: Sending attachments with HTTPS / SSL using servlets
 
Similar Threads
Content-Disposition: Download file name problem
file download dialog box - help me out
Unwanted browser window
Downloading from JSP
Internet Explorer is unable to open Office documents from an SSL Web site