Save the audio file by java applet in to the server side
<p>I developed the program to record audio by java applet, I used the following method to save the file: 
 public void saveToFile(String name, AudioFileFormat.Type fileType) {</p>

<pre><code>    if (audioInputStream == null) {
        reportStatus("No loaded audio to save");
        return;
    } else if (file != null) {
        System.out.println("now saving file in saveTo file!=null:"+name);
        createAudioInputStream(file, false);
    }

    // reset to the beginnning of the captured data
    try {
        System.out.println(" in saveTo file: reset");
        audioInputStream.reset();
    } catch (Exception e) { 
        reportStatus("Unable to reset stream " + e);
        return;
    }

    File file = new File(fileName = name);
    System.out.println(" in saveTo file:"+ file);
    try {
        if (AudioSystem.write(audioInputStream, fileType, file) == -1) {
            throw new IOException("Problems writing to file");
        }
    } catch (Exception ex) { reportStatus(ex.toString()); }
    samplingGraph.repaint();
}
</code></pre>

<p>but i want to save the file directly  to the server, because the file is saved in the client side and it saved in the directory of the browser such as: </p>

<p>file:///C:/Users/Mohammed/AppData/Local/Google/Chrome/Application/20.0.1132.47/</p>

<p>for this purpose, i also used the following method for keeping directory:</p>

<pre><code>public void init() {
        applet = this;
        String media = "./audio";
        String param = null;
        if ((param = getParameter("dir")) != null) {
            media = param;
        } 
        getContentPane().add("Center", demo = new JavaSound(media));
    }
</code></pre>

<p>I am appreciated to help me and give me an idea how can save the file in the current directory or saved in the server side. Thanks a lot.... </p>
