Are you using appletviewer or a browser? I think I remember that appletviewer failed on this.
Real programers are not afraid from maths! (I am)
(from an Asfixia Member I think)
JJpRiVaTe (Private Zone)
[java] applet read file on server
reading a file from the server works fine now but can anyone help with writing to a file on server?
I tried to pretty much do the reverse but I get an exception.
thanks
I tried to pretty much do the reverse but I get an exception.
public String readFile(String fileName, String data)throws IOException{ URL serverUrl = new URL(fileName); URLConnection urlc = serverUrl.openConnection(); BufferedWriter bw=new BufferedWriter (new OutputStreamWriter (urlc.getOutputStream())); for(int k=0;k<data.length();k++){ bw.write(data.charAt(k));}bw.close();}
thanks
You can''t write over http (which is what you''re reading through). You need to have an ASP/PHP/JSP/Servlet/Perl script/etc. on the web server that can accept your data and store it for you.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement