Saving text field value to disk as a file

Saving text field value to disk as a file

Hello,
I can't figure out how to save text from text field to server disk as file.

I get a value this way:

var text=$('#myTextField').val();

Now I want save text variable to disk (to the server disk where this script is working).