How to create a file by getting the filename from the user in javascript?
A:
Some more information might prove helpful, but if I take your question at face value the answer is "You can't".
Javascript run in the browser from a website (the most common way) has no access to the desktop and can't create a file on it.
Stomped
2010-04-09 14:14:17
+1
A:
Since javascript is a client-side language, you cannot create a file on the server using javascript alone. Probably the best thing to do is POST the variable with the filename to a PHP file.
lugte098
2010-04-09 14:14:55
JavaScript is not a client-side language. JavaScript is a language. The most common (by far) deployment of it is in web browsers, but that doesn't make it a client-side language. I use JavaScript for server-side scripting all the time, as well as for shell scripts.
T.J. Crowder
2010-04-09 14:22:18
sure, but i just assumed that the OP is using it for browser purposes...
lugte098
2010-04-09 14:25:22
@T.J. I have been thinking of using JavaScript on the server too via Aptana Jaxer. Which web server and JavaScript engine do you use?
Abbas
2010-04-10 19:12:28