is it possible to create a file on localhost with javascript?
+7
A:
Not in a webpage. If you're using Windows Script Host then yes you can through ActiveX, but I presume you're not doing that. You can however, send data back to the webserver through AJAX and have it store it for you.
Ray Hidayat
2009-01-31 09:04:58
+1
A:
no, this would be a security issue.
You can create a file through a plugin, see https://developer.mozilla.org/en/Code_snippets/File_I%2F%2FO
Pierre
2009-01-31 09:07:14
+3
A:
While this is generally not possible, you could write an application which depends on a browser extension like Google Gears which allows more local storage than a cookie would allow.
Paul Dixon
2009-01-31 11:39:16
A:
Create File
function openFile() { var filePath = 'c:/filename.txt'; var fileSysObj = new ActiveXObject('Scripting.FileSystemObject'); fileSysObj.CreateTextFile(filePath); }
This will create a file called "filename.txt" on your c:\ drive.
You must accept the ActiveX control or disable prompting to create a file.
create file
arijit
2010-09-29 06:40:36