title: Write file to another computer in local network with JS
body: <p>Currently I am writing to a file on my local storage via following commands:</p>
  
  <pre><code>var localFileName="localFile.txt";
  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
  var localFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
  localFile.initWithPath("C:\\MyLocalPath\..." + localFileName);
  </code></pre>
  
  <p>Now, if I want to write to a file on another PC in the same local network, can I also use the above pattern and only change the "initWithPath" to the IP (and path) of the other computer or do I have to use a different method or Java implementation?</p>
  
  <p>Note: This only has to be working on Mozilla Firefox, other browsers are of no importance.</p>
  
  <p>Best regards.</p>
  
  <p>Edit: As mentioned in the comments below using Java could be a good solution. At the moment I have the following code (which is working from "localhost" to "localhost"):</p>
  
  <pre><code>public static void startSender() {
          (new Thread() {
              @Override
              public void run() {
                  try {
                      Socket mySocket = new Socket("127.0.0.1", 60014);   // IP, Port
                      BufferedWriter outputStream = new BufferedWriter(new OutputStreamWriter(mySocket.getOutputStream()));
                      outputStream.write("it works... ");
                      outputStream.flush();
                  }
  // (+ catch Exceptions)
              }
          }).start();
      }
  
      public static void startServer() {
          (new Thread() {
              @Override
              public void run() {
                  ServerSocket myServerSocket;
                  try {
                      myServerSocket = new ServerSocket(60014);
                      Socket mySocket = myServerSocket.accept();
                      BufferedReader inputStream = new BufferedReader(
                              new InputStreamReader(mySocket.getInputStream()));
                      String line = null;
                      while ((line = inputStream.readLine()) != null) {
                          System.out.println(line);
                      }
                  }
  // (+ catch Exceptions)
                  }
              }
          }).start();
      }
  </code></pre>