First I want to create a text file in local system and also add contents to the file, after that I want to open that file.
Can't create file using the code, also want code to open a file from local system. Can any one help me or provide with details that is it possible?
<body>
<input type="button" value="create" onclick="createFile()"/>
<script type="text/javascript" language="javascript">
function createFile()
{
try{
var fso,file;
fso=new ActiveXObject("Scripting.FileSystemObject");
file=fso.CreateTextFile("D:\\ppp.txt");
file.WriteLine("AAAAA");
file.close();
}
catch(err){
alert(err.message);
}
}
</script>
</body>
While running in IE got the error:
Automation server can't create object
running in Chrome got the error:
ActiveXObject is not defined