184
rated 0 times
[
187]
[
3]
/ answers: 1 / hits: 92344
/ 11 Years ago, wed, july 3, 2013, 12:00:00
Is it possible to open a text file with JavaScript (location like
http://example.com/directory/file.txt) and check if the file contains a given string/variable?
In PHP this can be accomplished easily with something like:
$file = file_get_contents("filename.ext");
if (!strpos($file, "search string")) {
echo "String not found!";
} else {
echo "String found!";
}
Is there a way to do this? I'm running the "function" in a .js
file with Node.js, appfog.
More From » node.js