Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q994 Can I write to a file on the client machine?

You are here: irt.org | FAQ | JavaScript | File | Q994 [ previous next ]

Only in Netscape Navigator 4+ after requesting extra priviledges:

<script language="JavaScript"><!--
function writeToFile(fileName,text) {

netscape.security.PrivilegeManager.enablePrivilege('UniversalFileAccess');
    var fileWriter = new java.io.FileWriter(fileName);
    fileWriter.write (text, 0, text.length);
    fileWriter.close();
}

if (document.layers) {
    writeToFile('file.txt','Hello World');
}
//--></script>

Feedback on 'Q994 Can I write to a file on the client machine?'

©2018 Martin Webb