How do I write to a file that resides on another server? I've tried it with both a Socket and a URL.. I can read the text file without problems, but I cant write to it..
(I have already checked permisions)
So far, this was my latest attemp:
String data="Write this to file!";
URL myURL = new URL("URLConnection con = myURL.openConnection();
con.setDoOutput(true);
con.setDoInput(true);
con.setUseCaches(false);
con.setRequestProperty("Content-type", "text/plain"
;
con.setRequestProperty("Content-length", data.length()+""
;
PrintStream out = new PrintStream(con.getOutputStream());
out.print(data);
out.flush();
out.close();
Any suggestions that could at least point me in the right direction would be helpfull.
Thanks,
Greg
(I have already checked permisions)
So far, this was my latest attemp:
String data="Write this to file!";
URL myURL = new URL("URLConnection con = myURL.openConnection();
con.setDoOutput(true);
con.setDoInput(true);
con.setUseCaches(false);
con.setRequestProperty("Content-type", "text/plain"
con.setRequestProperty("Content-length", data.length()+""
PrintStream out = new PrintStream(con.getOutputStream());
out.print(data);
out.flush();
out.close();
Any suggestions that could at least point me in the right direction would be helpfull.
Thanks,
Greg