Reputation: 1
How to create a file by getting the filename from the user in javascript?
Upvotes: 0
Views: 105
Reputation: 2309
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.
Upvotes: 1
Reputation: 2100
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.
Upvotes: 0