View Full Version : writing data to txt file on external server

12-18-2011, 02:55 PM
well i'm kind of new to this website and scripting with javascript but i am wondering:
in a client side .js file i have some coding which results in a string which is stored in a variable called exportData

now i want that string to be written into a text file on a server but how do i do that?
it is not local on the client's pc and i can't find how to do it anywhere...
can you guys help me?


Philip M
12-18-2011, 03:33 PM
JavaScript is purely a client-side language, and unless used with an Ajax call has no capability to read from or write to a file (except a cookie), communicate with the server, access a database, the client's operating system or the Windows registry, or alter the default behaviour of the browser.

All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

12-18-2011, 03:50 PM
but then how can i do this?
is there any way to do this from my javascript file?
i have a php website hosted on a server and that's where i want to send it to
have you got a clue on how to do this then?


12-18-2011, 05:29 PM
I think he said it, you need to use Ajax (Javascript+PHP) to do it.


12-18-2011, 05:36 PM
Ow sorry, couldn't really find that in.his post
Thank you, both of you