1

I would like to write the data results from a form to the csv (or excel). I want to save this results in the server serverless (without php, etc.).

I have found this code:

<html>
  <head>
  <script language="javascript">
    function WriteToFile(passForm) {
      var fso = new ActiveXObject("Scripting.FileSystemObject");
      var fileLoc = "C:\\sample.csv";
      var file = fso.CreateTextFile(fileLoc, true);
      file.writeline(passForm.FirstName.value + ',' +
                     passForm.LastName.value);
      file.Close();
      alert('File created successfully at location: ' + fileLoc);
     }
  </script>
  </head>
  <body>
  <p>create a csv file with following details -</p>
  <form>
    Type your first name: <input type="text" name="FirstName" size="20">

    Type your last name: <input type="text" name="LastName" size="20">

    <input type="button" value="submit" onclick="WriteToFile(this.form)">
  </form>
  </body>
</html>
</br></br></html>

But it does work only with IE.

How to solve this problem?

Regards

Ganjira
  • 936
  • 5
  • 15
  • 31
  • *I want to save this results in the server serverless (without php, etc.)*. And how do you think that would work? – Bartek Banachewicz Sep 29 '15 at 13:05
  • If what you want is something that runs completely locally, with no server involved, and does things that are outside of the security model of the web, why not just write a simple native app? – smorgan Oct 01 '15 at 12:57

1 Answers1

1

as i understand your question and searched i found that

ActiveX is only supported by IE - the other browsers use a plugin architecture called NPAPI. However, there's a cross-browser plugin framework called Firebreath that you might find useful.

you can refer to this question

refer question 1

refer question 2

Community
  • 1
  • 1
Himesh Aadeshara
  • 1,710
  • 12
  • 22