Hi Tiana, First: how does the servlet kwnow in what machine it has to save the file? Second: not local servlets may have restrictions to file and network access. That means it is impossible to write a file in the client�s machine, if you don�t have permission to do so. That�s all I kwnow. Leila > -----Urspr�ngliche Nachricht----- > Von: Tiana Zhang [mailto:[EMAIL PROTECTED]] > Gesendet: Dienstag, 24. Oktober 2000 23:04 > An: [EMAIL PROTECTED] > Betreff: Help:How to save file on client's side > > > 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 > ___________________________________________________________________________ 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
