Read/Write File in Extenstion
Hi
How Can Create Or Read a File XML or etc whit JavaScript or etc in Extenstion?
And How Can Read XML File in Extension ?
Hi
How Can Create Or Read a File XML or etc whit JavaScript or etc in Extenstion?
And How Can Read XML File in Extension ?
You need to use the File object:
function readFile(path) {
var file = new File(path);
var fileOk = file.open("r");
if (fileOk) {
var content = file.read();
file.close();
return content
}
}
function writeFile(path, content) {
var file = new File(path);
var fileOk = file.open("w");
if(fileOk){
file.write(content);
file.close();
return file;
}
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.