Thank you. I need further assistance please
I tried this solution as follows:
My PHP is:
<?PHP
if (isset($HTTP_POST_VARS['audioo']))
{
$filename ="file.au";
if (!$fp = fopen($filename, 'a')) {
exit;
}
if (!fwrite($fp, $HTTP_POST_VARS['audioo'] )) {
echo "failed";
} else {
echo "ok";
echo $HTTP_POST_VARS['audioo'];
}
fclose($fp);
exit;
}
My applet has the following code:
URL url;
URLConnection con;
OutputStream oStream;
String parametersAsString;
byte[] parameterAsBytes;
String aLine;
parametersAsString = "audioo=";
parameterAsBytes = parametersAsString.getBytes();
int size = audioInputStream.available();
url = new URL("http","server", 80,"/abc/rece.php");
con = url.openConnection();
con.setDoOutput(true);
con.setDoInput(true);
con.setRequestProperty("Content=length", String.valueOf(parameterAsBytes.length + size));
oStream = con.getOutputStream();
oStream.write(parameterAsBytes);
int retval =0;
retval = AudioSystem.write(audioInputStream, fileType, oStream) ;
oStream.flush();
?>
I know for fact that the stream is getting populated. When I save this stream as a file on the local machine. It works.
Also file.au is getting created but is an invalid audio file and with a size 1 kb only. It conatins "&snd" only.
Help please
Thanks