I have a simple need but in node.js I know it can't be done do to security.
b.writeTextFile does not seem to work either.
My need is for a user to input a file name and have this file name saved on
the server for future append to file.
Like saving encoder values.
This will log the user input but "Cannot read property 'writeFile' of
undefined"
If anyone has any ideas please help.
var fs = require('fs');var input = document.getElementById('filename');var
fileName = input.value;
function recordToFilename() {var input =
document.getElementById('filename');var fileName = input.value;var qw =
fileName;
if (qw) {
alert('value of: ' + qw);
console.log(qw);
// demo output
var myObject = {
qw: qw,
fullN: function() {
return this.qw;
}
};
document.getElementById("demo").innerHTML = myObject.fullN();
var path = "danny.txt";
var data1 = "jdsfhadj"
fs.writeFile(path,data1)
//end demo output code
} else {
alert('Please enter a filename!');
input.focus();
}};
HTML Code:
<html><head>
<title>writeFile</title>
<script src="jquery.js"></script>
<script src="bonescript.js"></script>
<script src="test_3.js"></script></head><body>
<label for="filename">Filename</label>
<input name="filename" id="filename" type="text">
<a id="enter_button" onclick="recordToFilename();"
href="javascript:void(0);" title="enter">enter name</a>
<br>
<p id="demo"></p></body></html>
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.