Hello,

I created a servlet and hosted it on my machine. One of the functions of this
servlet is to save an output generated by the servlet to a client's machine.
In my servlet, when user enter the directory which he/she wants to save the
file(e,g C:\temp\), the file will be saved in that dir.

The weird thing is that file has been saved in my machines instead of the
client's local box. Can anyone tell me how to fix it?

The code to save the file is:

public boolean saveInfoInText(String line, String filename, PrintWriter pw) {


        File f = new File(filename);
        FileWriter out = new FileWriter(f);

        out.write(line);
        out.flush();
        out.close();
}

Thanks very much
Tiana

___________________________________________________________________________
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