[java] applet read file on server

Started by
12 comments, last by mr2071 21 years, 10 months ago
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)
-=[ J ]=-I always forget to change the tagline.
Advertisement
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.


  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.
"There is no reason good should not triumph at least as often as evil. The triumph of anything is a matter of organization. If there are such things as angels, I hope that they're organized along the lines of the mafia." -Kurt Vonnegut
Ah, thanks. It''s not necessary.

This topic is closed to new replies.

Advertisement