Hello all!
Is it possible to write to a file on the server end just with JavaScript?
When I want to POST to my server, can I write to a file in a similar manner as GET?
[CODE]var http = new XMLHttpRequest();
http.open(“POST”, “http://localhost/apache2-default/post.txt”, false);
http.send(“I write!!”);
if(http.status == 200)
{
alert(“Written ok!”);
}
else
{
alert(“Error while reading file!”);
}
I get the alert “Written ok! ” but nothing happens if there is a file called “post.txt” already in folder, nothing written in file though. If the file does not exist I get the error.
Please get me on the right track!!
Many thanks!
Marcus