Reputation: 1
File posisifileXML = new File("namefile.xml");
Writer outXML = new BufferedWriter(new FileWriter(posisifileXML));
outXML.write(String1);
outXML.close();
I have created Java applet in Linux, the program is used to create a namefile.xml
, when I'm accessing java applet from the browser (with that Linux) to create a file, it's worked. That file is saved in my home directory. But the problem is when I'm accessing that Java applet from the browser with another computer (Windows 7), then appeared an error:
java.io.FileNotFoundException:namefile.xml (Access is denied)
oh sorry, I want to create a file from client's computer (windows 7) to the server's computer via the client's browser (using java applet)..
What should I do?
Upvotes: 0
Views: 5938
Reputation: 168815
File posisifileXML = new File("namefile.xml");
Never dump a File
from an applet into the 'default directory'. Make that something like:
File posisifileXML = new File(
new File(System.getProperty("user.home")),
"namefile.xml");
I want to create a file from client's computer (windows 7) to the server's computer via the client's browser..
An applet on the client computer can not create or access a File
on the server, security aside. File objects just do not work that way.
In order to get information from the user to be saved on the server file-system, requires help from the server.
Upvotes: 0
Reputation: 22995
You should have posted the code :(
However, I have had the same issue because of the following two issues, when I was working with Applets
Upvotes: 1