1

i am trying to make a file in javascript, but it doesn't be saved in the root. when the file is made, the sentence i write has to be stored in the file. or loading a sentence from a textbox is also fine for me. can anyone give me help??

function createFile() {
var fso = new ActiveXObject('Scripting.FileSystemObject');
var fileObj = fso.CreateTextFile("G:\\soonrok.txt", true);
fileObj.WriteLine("Hello, I am Soonrok!!!");

}

<td>
    <input type="button" value="save" onClick="createFile()">

6
  • 5
    ActiveX: How to make your site unavailable to most people in one easy step. Commented Oct 11, 2012 at 6:09
  • 1
    A previous question talks about how to do it in Chrome stackoverflow.com/questions/7160720/… but I am not sure about other browsers Commented Oct 11, 2012 at 6:11
  • 1
    @NullUserException - Coprporate LAN only implementation: how to make your site unavailable to all except those with permission to view (and a company mandated browser) Corporate IT 101 mate.. Commented Oct 11, 2012 at 6:18
  • @enhzflep - the real point is that ActiveX is an obsolete technology, and is known to be insecure, and only works in old browsers which are also known to be insecure. Corporates that are still using it deserve all the hacks they get. Commented Oct 11, 2012 at 6:20
  • 1
    @Spudley - no doubt it's 'obsolete' (despite IE10 supporting it). Old bowsers only? bulsh1t. Deserve all the hacks they get? :Ooof: you trying to tell me that corps that have a lan that's not connected to a wan are susceptible? No more so than any other business is of being ripped-off by it's employees. Now then, the point of my remark was that it would be forgivable for thinking Null's comment was just as snarky and smart-assed as mine was.. It certainly added next-to-nothing, just as mine did! Commented Oct 11, 2012 at 6:49

1 Answer 1

1

The best you're going to be able to do with JavaScript is create a cookie.

Or you could do something that only works for IE with ActiveX.

Or see the link from @AurA for Chrome Only tricks and/or ways to download files from a server.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.