By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,385 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,385 IT Pros & Developers. It's quick & easy.

Writing a File on Web Server

P: 1
when i wrote the below code.

it does not create the file.
but if i give like below:


it does...
how would write the file in the above writes it in local machine of user.
Sep 15 '06 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 15k+
P: 16,027
To write a file on the web server, you need a server-side language. JavaScript cannot write to the server (at least not on its own).
May 13 '08 #2

rnd me
Expert 100+
P: 427
provided that write permission are available:

Expand|Select|Wrap|Line Numbers
  1. function IO(U, V) {
  2. //LA MOD String Version. A tiny ajax library by  DanDavis
  3.     var X = !window.XMLHttpRequest ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest();
  4. ? 'PUT' : 'GET', U, !1);
  5.     X.setRequestHeader('Content-Type', 'text/html')
  6.     X.send(V ? V : '');
  7. return X.responseText;}
  10. var content = "hello world"
  11. var url ="test1.txt"
  13. IO( url, content);
May 15 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.