Hi y'all...

I'm really in need of someone who knows Java applets and CGI-scripting. I am trying to use my Java applet (game) to read/write from/to my webserver. I've managed to accomplish the read-part...Now the writing is a lot more difficult. I know about the security issues and all. My applet is communicating with a CGI-script on my webserver...Now; the code and all looks fine (to me), but it just will not work:

The part of my Java code that handles the writing-procedure is the following:


public void SendData(String data) throws Exception {
try{
URL fileUrl = new URL("http://ftp.domain.nl/~user.domain.nl/public_html/Game/wdwrite.cgi");
URLConnection url = fileUrl.openConnection();

url.setUseCaches(false);
url.setRequestProperty("Content-Type", "text/plain");
url.setDoInput(false);
url.setDoOutput(true);

PrintStream outStream = new PrintStream(url.getOutputStream());
outStream.print(data);
outStream.flush();
outStream.close();

url.setDoInput(true);
url.setDoOutput(false);
BufferedReader inFile = new BufferedReader(
new InputStreamReader(
url.getInputStream()));

String inStr = new String();
while ((inStr = inFile.readLine()) != null){
System.out.println(inStr+"\n");
}

inFile.close();

}
catch(MalformedURLException ex1)
{
System.out.println("URL not found...");
}
catch(IOException ix1)
{
System.out.println("File not found...");
ix1.printStackTrace();
}


}


This should do the trick, some experts say on the Internet...Now, my CGI-script looks like this:


#!/usr/bin/perl
# wdwrite
# this is the CGI that will take the # applet info and write it to a file

print "Content-type: text/plain\n\n";
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # the amount of data coming in.

open(OUTF, ">>scorelist.txt");
print OUTF $buffer;

close (OUTF);
exit 0;


That's all...looks great...but does not work :'(
What is the problem? Btw: all the files are in the same directory, namely: http://ftp.domain.nl/~user.domain.nl/public_html/Game/

and of course domain stands for something else....Hope one of you can figure it out...I can not...

Thanx already!