How can I save a string in a text file ? My way : . . . BufferedWriter file; String s = new String("Test"); file = new BufferedWriter(new FileWriter("textfile.txt")); file.write(s); . . . does'nt work ! (I wrote this sourcecode without the book, where I read that. It is possible that there are some mistakes.) I wrote that as an applet, but the file was not created. HELP PLEASE !!
No you cannot create a text file on a local machine using Javascript or HTML. But I think you can create a text file using a signed applet using JDK 1.2. When the user requests a page containing this applet, the browser asks the user whether or not to download the applet and give permission to create a file. If the user agrees, then the applet can create a text file. Otherwise no.
Originally posted by Bonkers: How can I save a string in a text file ? My way : . . . BufferedWriter file; String s = new String("Test"); file = new BufferedWriter(new FileWriter("textfile.txt")); file.write(s); . . . does'nt work ! (I wrote this sourcecode without the book, where I read that. It is possible that there are some mistakes.) I wrote that as an applet, but the file was not created. HELP PLEASE !!