As I know of that IE always has a way of detecting the contentType
automatically(if it can) no matter what you set the contentType to be. So,
your user probably just have to do a file save by themselves if they use IE.
Correct me if I am wrong or if you find out a way of fooling the IE, I'd
really want to know as well.

Thanks

Molly

-----Original Message-----
From: Heim, Thomas [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 30, 2000 8:30 AM
To: [EMAIL PROTECTED]
Subject: saving file on client


Hi,

i have a servlet that edits a file. After editing the file i want to save
the file on the requesting client. Here ist the code i tried:

...
response.setContentType("application/octet-stream");
BufferedWriter out = new BufferedWriter (new
OutputStreamWriter(response.getOutputStream()));

try {
        BufferedReader reader = new BufferedReader(new FileReader(path));
      out.write (reader.read ());
} catch(FileNotFoundException ex) {}
...

When i use this with netscape it works fine, the browser opens a save dialog
and saves the file (only one byte, but for testing it is o.k.). With IE it
doesn�t work.

How can i save a file on client side out of my servlet???

Thanks,
Thomas

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to