tags:

views:

34

answers:

4

How to create a file by getting the filename from the user in javascript?

A: 

If you are using IE you can do it using ActiveX and FSO, though it is highly not recommended. No other browser would let you do it.

Abbas
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
+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
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
sure, but i just assumed that the OP is using it for browser purposes...
lugte098
@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
A: 

Im guessing here that you want to use ?

James Westgate