getravi2k
asked on
How to POST an audio to a servlet?
Hi,
I have a requirement.
In the current set up in production. There is a Tomcat server running.
When you call to a particular number it starts an IVR and it routes the call to bevocal and from there it is posted to our Production Tomcat server running.
In order to minimise the call everry time. what i am planning to deploy the whole production application locally on my m/c and i need to post a audio file to my tomcat servlet.
Plz let me know on how i can achieve it.
Regs,
Ravindra N
I have a requirement.
In the current set up in production. There is a Tomcat server running.
When you call to a particular number it starts an IVR and it routes the call to bevocal and from there it is posted to our Production Tomcat server running.
In order to minimise the call everry time. what i am planning to deploy the whole production application locally on my m/c and i need to post a audio file to my tomcat servlet.
Plz let me know on how i can achieve it.
Regs,
Ravindra N
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have solved the problem with this code.
URI doc_url = new URI("http://localhost:8080/audioxml/XXX_submitRequest.jsp");
URI form_uri = new URI(doc_url, "");
HTTPConnection con = new HTTPConnection(form_uri);
// create the NVPair's for the form data to be submitted and do the
// encoding
NVPair[] files = { new NVPair("upload_file", "C:\\xxx_recordings\\recor
NVPair[] opts = { new NVPair("secret", "data") };
NVPair[] hdrs = new NVPair[1];
byte[] form_data = Codecs.mpFormDataEncode(op
// POST the form data, as indicated by the method attribute
HTTPResponse rsp = con.Post(form_uri.getPathA