Yes that works for reading a file. But I am still not able to write to a file. Here is my last try.
String fileName = "data/temp.dat";
URL url = new URL(calApplet.getDocumentBase(), fileName);
URLConnection connection = url.openConnection();
out = new PrintWriter(connection.getOutputStream());
out.write("This is a test",0, outString.length());
Before this when I had the Applet as a file in the dirctory I was using FileWriter and I didn't have any problems. The FileWriter doesn't seem to work when going from a webserver. I would appreciate any help.